作者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
1F:推 paul20:大神出現! 快拜! 01/14 00:12
2F:推 lotuslin1222:耶謝謝!!剛才卡住現在通了!! 01/14 00:13
3F:→ flysky46:現在就像通樂一樣順 01/14 00:14
4F:推 a1598742002:是用過通樂一樣吧 01/14 00:16
5F:推 flysky46:玉米不要一直放爛梗 01/14 00:27
6F:→ a1598742002:XDDDDDDDDD 01/14 00:35
7F:推 len781231:為什麼第4個是15啊 01/14 00:37
8F:推 escrowdis:恩阿 不是應該是5? 01/14 02:01
9F:推 escrowdis:幹打死都不是5.. 01/14 02:03
10F:推 escrowdis:幹打死都不是5.. 01/14 02:03
11F:推 escrowdis:幹打死都不是5.. 01/14 02:04