下面是我的代码:
//variables
double sSideA,sSideB;
double incrementA,incrementB;
double eSideA,eSideB;
//obtain user input
cout << "Please enter the starting value of side A: ";
cin >> sSideA;
cout << "Please enter the end value of side A: ";
cin >> eSideA;
cout << "Please enter the increment value of side A: ";
cin >> incrementA;
cout << "Please enter the starting value of side B: ";
cin >> sSideB;
cout << "Please enter the end value of side B: ";
cin >> eSideB;
double hypo[eSideA][eSideB]; //initialize multidimensional array
我正在尝试创建一个多维数组,其大小由用户输入决定。我从Microsoft Visual Studio收到错误,指出hypo
必须只包含常量值。
是否可以生成由用户的eSideA
和eSideB
确定的数组?
谢谢。