Arrays with no set value

I am having trouble with arrays in my programming class. In the program I must create, I have to be able to make an array with no set number of spaces. IE: array[234]. I cannot for the life of my figure out how to do this. The program will be using file input and output, and the input file has to be able to be changed to have any number of items. Help would be great, thank you.

1
2
3
int n;
cin >> n;
int* array = new int[n];
Topic archived. No new replies allowed.