【发布时间】:2012-01-08 12:07:59
【问题描述】:
the_project.c:73:22: error: subscripted value is neither array nor pointer nor vector
上面给出了错误,下面是第 73 行。
customer_table[my_id][3] = worker_no;
我声明数组全局如下
int *customer_table; //All the info about the customer
这行代码在一个不在 main 中的函数中。 我主要为这个全局数组分配内存。 这可能导致此问题的原因是什么?
【问题讨论】:
-
错误消息中的“nor vector”部分让我觉得您正在编译为 C++,而不是 C。如果您想编译 C 代码,请使用 C 编译器。
-
@KeithThompson 我正在使用 gcc
-
有趣。它与gcc extension 相关。