off the top of my head, the closest way to do this is to declare it dynamically at run time:
cpp
//user input
int* ptr = new array[userSize];
//stuff
You cannot have uninitialized variables/data structures. The program must allocate memory and an array with 'n' elements cannot be allocated.