我基本上有
int x;
cout << "Please enter how many classrooms there are: ";
cin >> x;
classrooms bunchaClassrooms[x]; //classrooms is a previously declared class.
出于某种原因,它给出了错误“非POD元素类型'x'的可变长度数组”,我不知道为什么,如果我要使用教室向量,我怎么能轻松填充它(使用for循环我猜)取决于用户的输入。
我基本上有
int x;
cout << "Please enter how many classrooms there are: ";
cin >> x;
classrooms bunchaClassrooms[x]; //classrooms is a previously declared class.
出于某种原因,它给出了错误“非POD元素类型'x'的可变长度数组”,我不知道为什么,如果我要使用教室向量,我怎么能轻松填充它(使用for循环我猜)取决于用户的输入。