为什么第二次输出的字符串a不正确?
#include<stdio.h>void main()
{
void copy_string(char from[],char to[]);
char a[]="i am your husband";
char b[]="you are my wife.";
printf("string a is:%s\nstring b is:%s\n",a,b);
copy_string(a,b);
printf("string a is:%s\nstring b is:%s\n",a,b);
}
void copy_string(char from[],char to[])
{
int i=0;
while(from[i]!='\0')
{to[i]=from[i];i++;}
to[i]='\0';
}