不是说数组的维数不能是 非const 变量吗?可下面的程序为什么编译成功而且运行正确?难道是编译器的问题?我目前用的编译器是DEV C++ 5.6.1
#include<iostream>
using namespace std;
int main()
{
size_t array_type = 10;
int array[array_type];
for (size_t ix = 0; ix != array_type; ix++){
array[ix] = ix + 1;
cout << array[ix] << " ";
}
return 0;
}