#include<stdio.h> #include<string.h> int main() { char t[80],s[80]="Hello"; strcpy(t,s); puts(t); strcpy(t,"World"); puts(t); return 0; }
不是的,strcpy是拷贝覆盖,而不是拼接,如果要用拼接用strcat函数可以实现拼接本代码就是输出HelloWorld