[問題] 基本c語法問題
遇到的問題(Question):
char s[] ="Hello";
char p[]= "TEST!";
p=s;
為什麼p=s會出錯呢?~不能直接copy字串過去嗎?
餵入的資料(Input):
希望的正確結果(Expected Output):
跑出來的錯誤結果(Wrong Output):
error C2106: '=' : left operand must be l-value
開發平台(Platform): (例: VC++, Gcc, OpenGL, Linux, ...)
VC2008
程式碼(Code): (請善用置底文標色功能)
如上問題內容
補充說明(Supplement):
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 222.156.254.85
→
12/07 18:13, , 1F
12/07 18:13, 1F
→
12/07 18:18, , 2F
12/07 18:18, 2F
→
12/07 18:35, , 3F
12/07 18:35, 3F
→
12/07 18:51, , 4F
12/07 18:51, 4F
→
12/07 18:55, , 5F
12/07 18:55, 5F
→
12/07 19:45, , 6F
12/07 19:45, 6F
→
12/07 20:50, , 7F
12/07 20:50, 7F
推
12/08 08:44, , 8F
12/08 08:44, 8F
→
12/08 08:45, , 9F
12/08 08:45, 9F