假設傳遞一個字串給函數strpcy
strpcy(s,t)
char *s, *t;
{
while(*s++ = *t++);
}
請問
(1)為什麼當t指向'\0'時 while會停止迴圈
(2)為什麼當*s 和 *t 宣告為 int 時 , while迴圈無停止機制
以上
謝謝各位大大了
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.59.234.238
※ 編輯: adddream 來自: 61.59.234.238 (02/24 17:13)