close
style

C-style的字串?

C-style的字串是什麼?怎宣告?..............
什麼是C-style字串? C-style字串就是在一個字元陣列裡的字串是以’\0’結尾的話那此字串就叫做C-style字串. 比如說:char str[] = “hello”;此字串是由hello外加一個’\0’這6個字元組合而成. ‘\0’就是ascii代號為0的字元或(char) 0.自己試試看. 以下的cout.cout

arrow
arrow

    玩樂天下 發表在 痞客邦 留言(0) 人氣()