作者sdg85732 (wei)
看板NTUBIME102HW
標題[C++ ] 考古題第四題
時間Thu Jan 14 00:08:12 2010
這個大家就先看看吧
因為老師上課好像沒交過
(應該不會考吧)
需要的標頭檔 #include <cstring>
1. strcpy(目標,來源) 從來源複製到目標,包括'\0'
ex: strcpy(string1,"hello world")
2. strcat(字串,stringExp) 字串後接stringExp
ex: strcat("hello world","there") 輸出為 hello worldthere
3. strlen(字串) 算字元數
ex: strlen("hello world") 的值是11
4. strcmp(字串1,字串2) 兩個字串比大小
(1)當1<2回傳負整數 , 1=2回傳0 , 1>2回傳正整數
(2)從第一個字元比較
ex:"hello" is greater than "good bye"(因為"h">"g")
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.169.176.206
推 paul20:大神出現! 快拜! 01/14 00:12
推 lotuslin1222:耶謝謝!!剛才卡住現在通了!! 01/14 00:13
→ flysky46:現在就像通樂一樣順 01/14 00:14
推 a1598742002:是用過通樂一樣吧 01/14 00:16