我需要创建一个程序,用户输入所需的数组大小,然后C++代码创建它,然后允许数据输入.
这适用于Code Blocks IDE,但不适用于Visual Studio Community 2015
当我在CodeBlocks版本13.12中放入以下代码时,它可以工作
#include<iostream>
using namespace std;
int main()
{
int count;
cout << "Making the Array" << endl;
cout << "How many elements in the array " << endl;
cin >> count;
int flex_array[count];
for (int i = 0; i < count; i = i + 1)
{
cout << "Enter the " << i << " term " << endl;
cin >> flex_array[i];
}
for (int j = 0; j < count; j …Run Code Online (Sandbox Code Playgroud)