考虑这个代码段:
char message[255];
char newMessage[255];
int i;
for (i = 0 ; i < 255 ; i++)
message[i] = i;
newMessage = message;
当我尝试这样做时,我在最后一行得到一个错误:
incompatible types when assigning to type ‘char[255]’ from type ‘char *
如果数组具有相同的类型,为什么我会得到它?我如何解决它?
提前致谢