My first thought was
int size = 0;
cout << "Enter size of the array" << endl;
cin >> size;
int a[size];
Now I know that an array has to have a constant value, but I need that the user enters an integer and use that integer as the size of the array. Any idea how?