利用函数进行数组copy
#include <stdio.h>void main()
{
void cop(char x[],char y[]);
char a[] = "The boy is very cool!",b;
printf("The string a:%s\n",a);
printf("The string b:");
cop(a,b);
printf("\n");
}
void cop(char x[],char y[])
{
int i;
for(i = 0;x != '\0';i++)
{
y = x;
}
y = '\0';
for(i = 0;y != '\0';i++)
{
printf("%c",y);
}
}
页:
[1]