the_project.c:73:22: error: subscripted value is neither array nor pointer nor vector
它给出了上面的错误,并且第73行是以下内容。错误:下标值既不是数组,也不是指针,也不是C中的向量
customer_table[my_id][3] = worker_no;
我声明阵列全球如下
int *customer_table; //All the info about the customer
这行代码是在函数不在主。 而我在这个全局数组中分配内存。 这可能会导致这个问题?
错误消息的“也不是矢量”部分对如果你想编译C代码,我觉得你作为编译C++,而不是C.,使用C编译器。 – 2012-01-08 12:38:44
@KeithThompson我正在使用gcc – 2012-01-08 12:40:00
有趣。它与[gcc扩展]相关(http://gcc.gnu.org/onlinedocs/gcc-4.6.2/gcc/Vector-Extensions.html)。 – 2012-01-08 12:46:22