首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

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

2013-10-01 
C++出现的,求解我是初学者,求expected constant expression是什么原因呀[解决办法]1,运行程序之前的窗口未

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
[解决办法]
数组的下标需要是常量表达式  而不是变量

热点排行