user generated array

i'm wondering how to do a user generated array,

have a user enter a variable to enter array size, then i dont know how to have the user enter specific numbers for their generated array
You can't dynamically size an array. The compiler needs to know the array size at compile time. Consider using vectors.

http://www.cplusplus.com/reference/stl/vector/
Last edited on
It is possible to dynamically allocate space for an array, but you have to use pointers, new, and delete [].

http://www.cplusplus.com/doc/tutorial/dynamic/

EDIT: here's the link to learn about arrays.
http://www.cplusplus.com/doc/tutorial/arrays/
Last edited on
Topic archived. No new replies allowed.