剛開始學C51,是因為使用system.h的strcat函數拼接字符串,發現不能拼接。看了strcat實現方式
char* Strcat(char *dst, const char *src)
{
assert(dst != NULL && src != NULL);
char *temp = dst;
while (*temp != '\0')
temp++;
while ((*temp++ = *src++) != '\0');
return dst;
}
發現*temp++ = *src++這個執行了但并沒有真正的把*src賦值給*temp。所以才有的這個疑問。 |