#include<stdio.h>
#include<string.h>
char *linkstr(char *str0, char *str1)
{
char *s1 = str0,*s2 = str1,*s0;
char s[1000];
s0 = s;
while (*s1 != '\0')
{
*s0 = *s1;
s0++;
s1++;
}
while (*s2 != '\0')
{
*s0 = *s2;
s0++;
s2++;
}
*s0 = '\0';
return s;
}
void main()
{
char *s;
char s1[8] = "adzccwe", s2[10] = "xxx1234'p";
s=linkstr(s1, s2);
puts(s);
getchar();
getchar();
}
写一个函数char *linkstr(char *str0 char *str1),将两个字符串str0和str1连接起来
最新推荐文章于 2023-03-22 22:50:34 发布