首先要定义2个数组
然后输入2个字符串
再分别求出字符串的长度
接着比较2个字符串的大小
最后链接在一起
下面是我自己弄的,请看看
#include
#include
int main()
{
char q[50],p[10];
gets(q);
gets(p);
printf("q的字符串长度为%d\n",strlen(q));
printf("p的字符串长度为%d\n",strlen(p));
printf("%d\n",strcmp(q,p));
printf("%s\n",strcat(q,p));
return 0;
}