字符串函数
#include <stdio.h>
#include <string.h>
int main()
{
char s1[100]="";
char s2[]="我爱,";
char s3[]="慕课网";
/*在以下补全代码*/
strcat(s2,s3);
strcpy(s1,s2);
printf("%s\n",s1);
return 0;
}为什这样写,没有输出?
#include <stdio.h>
#include <string.h>
int main()
{
char s1[100]="";
char s2[]="我爱,";
char s3[]="慕课网";
/*在以下补全代码*/
strcat(s2,s3);
strcpy(s1,s2);
printf("%s\n",s1);
return 0;
}为什这样写,没有输出?
举报