Setting dimensions of an array

How could I initialize an array by a size given to me by the user? I need to be able to pass this array to a function that takes in int myArray[] as a parameter so the way I tried, using vector, didn't work. Any suggestions?
Found the answer....

1
2
3
int maxSize;
cin << maxSize;
int* arr = new int[maxSize];
Topic archived. No new replies allowed.