要做C++我使用的是dev C++。现在我需要与Visual Studio工作C++数组Visual Studio
我做同样的程序,但在Visual Studio中我有我以前没有在C++中
与此
int project = (rand() % 5) + 1 ;
int P[project][3];
我有一个错误以下错误:
error C2057: expected constant expression
error C2466: cannot allocate an array of constant size 0
error C2133: 'P' : unknown size
你能帮助理解这个错误吗?
谢谢
好吧,一些编译器支持这个,但它肯定是一个扩展(请参阅http://stackoverflow.com/questions/1204521/dynamic-array-in-stack) – 2013-03-18 07:17:10