1

I found a difficulty on creating an array with user defined size. It shows error, can anybody teach me how to do this?

int main()
{
    int row, column;
    cout << "Enter the amount of row" << endl;
    cin >> row;
    cout << "Enter the amount of column" << endl;
    cin >> column;
    int array[row][column]; //the value of variable cannot be used as a constant
    system("pause");
}
Paul R
  • 202,568
  • 34
  • 375
  • 539
JC YOUNG
  • 53
  • 9

0 Answers0