C++ expected constant expression
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: #include #include #include #include #include using std::ifstream; using namespace std; int main (void) { int count=0; float sum=0; float maximum=-1000000; float sumOfX; float sumOfY; int size; int negativeY=0; int positiveX=0; int negativeX=0; ifstream points; //the points to be imported from file //points.open( "data.dat"); //points>>size; //cout>(x[count][0]); //cout>(x[count][1]); //cout This program is giving me expected constant expression error on the line where I declare float x[size][2]. Why? 回答1: float x[size][2]; That doesn't work