#include <stdio.h>
#include <string.h>
int main()
{
char s1[100]="";
char s2[32]="18岁少年想当软件工程师";
char s3[]="慕课网";
printf("%s\n",strcat(s2,s3));
return 0;
}
你可以先用strlen看一下s2和s3的长度,看看两个加起来是不是超过了内存
的确不能重叠,但是它是直接加在s2后面的。