读书人

C++出现的求解,该怎么解决

发布时间: 2013-10-01 12:15:56 作者: rapoo

C++出现的,求解
我是初学者,求expected constant expression是什么原因呀
[解决办法]

1,运行程序之前的窗口未关闭
2,缺少头文件
3,缺少引导文件


如果以上解决不了 请把出错代码发出来
[解决办法]
引用:
我是初学者,求expected constant expression是什么原因呀

贴上代码看看
[解决办法]
引用:
我是初学者,求expected constant expression是什么原因呀


For example, if you want to define an array, you need constant expression for array size:

int n(10); // n is int but not constant
int array[n]; // this will fail, n needs to be constant expression

const int N(10); // N is constant
int array[N]; // no problem here
[解决办法]
数组的下标需要是常量表达式 而不是变量

读书人网 >C++

热点推荐