#include <stdio.h>
int main()
{
char s[] = "churchgate: no church no gate";
char t[25];
char *ss, *tt;
ss = s;
while (*ss != '\0')
*tt++ = *ss++;
printf("%s\n", t);
return 0;
}
这段代码有什么问题? 当我尝试运行它时。它显示了一些垃圾值。
最佳答案
你永远不会将 tt
指向任何东西。您需要将其指向 t
:
tt=t;
关于c - 字符串代码显示错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13350768/