The size of array in c++ can be variable,but it must be dinamic allocation.Use keyword new to do that and you must be familiar with pointers.For example dinamicaly allocated array of int would be:
...
int n;
cin>>n;
int* array=new int[n];
...
Now you can use it as any other array, so this works fine (if n>=1):
int p=array[1];
Hope you can make it .Search google for it a bit more, you will find it for sure.