求助,为什么这段代码会出现“该内存不能为written"的问题?
#include <stdio.h>void copy_string(char *from, char *to)
{
for( ; *from != '\0'; from ++, to ++ )
{
*to = *from;
}
*to = '\0';
}
int main()
{
char *a = "I am a teacher";
char *b = "You are a student";
//copy_string(*a, *b);
copy_string(a, b);
//puts(*b);
puts(b);
return 0;
}