如题,
`int n;
cin>>n;
int a[n];
c++可不可以这样初始化数组啊,在VS2010中不可以,在devc++(编译器gcc) 中可以。
天蓬老师2017-04-17 14:31:46
This is the variable length array VLA in the C language C99 standard, which is not supported by the C++ standard. The gcc compiler supports variable-length arrays, but the vc compiler does not. Search for variable length arrays. There will be a lot of information on this (in Chinese and English). Stroustrup, the father of C++, talked about variable-length arrays on his website. There is a short paragraph. If you are interested, you can check it out http://www.stroustrup.com/bs_...