You are viewing a single comment's thread. Return to all comments →
C++ does allow for this. The correct way is to create a one-dimensional array having a size that's unknown at compile time is:
// array size int n; cin >> n; // create array of unknown size n DataType* arrayName = new DataType[n];
Seems like cookies are disabled on this browser, please enable them to open this website
Variable Sized Arrays
You are viewing a single comment's thread. Return to all comments →
C++ does allow for this. The correct way is to create a one-dimensional array having a size that's unknown at compile time is: