【发布时间】:2022-11-28 02:56:01
【问题描述】:
所以这是代码:
#include <stdio.h>
int main() {
char str1[] ="Hello", str2[20] ="Hi";
char *p ="Hello", *s ="Hi";
str1 = "Adieu";
return 0;
}
现在我的书给出了这个理由
error, constant pointer cannot change
当我运行它时,出现以下错误:
error: assignment to expression with array type
我的问题是为什么我的书这么说?指针从哪里来的?
这本书是让我们C如果您需要参考。
【问题讨论】:
标签: c compiler-errors