admin 管理员组

文章数量: 887016


2024年2月6日发(作者:madeinspace什么意思)

//1.1

输出"Hello Word"#includeint main()

{

int mystrcat(char p1[], char p2[]);

char a[80] = "lanbing";

char b[40] = "nihao";

mystrcat(a, b); printf("%s", a);

return 0;}void mystrcat(char p1[],char p2[]){ int i,j;

for(i=0;p1[i]!='0';i++); for(j=0;p2[j]!='0';j++) {

p1[i]=p2[j];

i++; }

p1[i]='0';//细节最后赋值'0'}#includeint main()

{

int mystrcmp(char str1[], char str2[]); char a[80] = "12345lanbing"; char b[40] = "nihao"; mystrcpy(a, b);

printf("%s", a);

return 0;}int mystrcpy(char str1[], char str2[]){ int i = 0, j = 0; while (str2[i] != '0')

{ str1[j] = str2[i];

j++;

i++;

}

printf("%sn", str1);

return 0;}


本文标签: 意思 赋值 作者 细节