invalid types ‘<unresolved overloaded function type>[int]‘ for array subscript|

it2023-07-22  88

记录一下错误error: invalid types ‘[int]’ for array subscript| 这个错误产生的原因是由于我定义数组的时候出错了先看代码吧

#include<stdio.h> int main() { int n; n=5; int a[n]; }

原因就在于像这样定义一个数组,只要一使用就会报这样的错误,当然并非报这样的错误就是由于这个原因,这只是原因之一,一般而言,我们都知道不可以这样来定义数组,但是由于写多了,写的有点懵了,犯了这样的错误,自己半天还看不出来。

最新回复(0)