字符串處理函數

##ide

  • gets函數以回車做爲字符串結束標誌, scanf函數則以空格做爲
  • 字符串處理函數

string.h函數

  1. 輸入字符串函數 puts(自動換行)
  2. 輸出字符串函數 gets
  3. 字符串鏈接函數 strcat
  4. 字符串複製函數 strcpy
  5. 字符串比較函數 strcmp
  6. 檢測字符串長度函數 strlen(不包括\0)
  7. 字符串小寫函數 strlwr
  8. 字符串大寫函數 strupr

strcat(a,b),將b鏈接到a後面,存放在a中(先去除a的\0)
strcpy(a,b),將b複製到a中
strcmp(a,b),若是a==b則函數值爲0字符串

相關文章
相關標籤/搜索