这是另一个
question的延续.
请考虑以下代码:
char *hi = "hello"; char *array1[3] = { hi,"world","there." };
它不会令我感到惊讶(显然我不知道C语法以及我的想法),并产生以下错误:
error: initializer element is not constant
如果我将char *更改为char [],它会编译好:
char hi[] = "hello"; char *array1[3] = { hi,"there." };
有人可以向我解释为什么吗?