Handling array overflow exception in catch block c++ program

Handling array out of index bound exception using catch block, here size of array can be increased if more number want to be inserted into the array.  C++ program using try catch block with explanation. This sample code explains how to create a array and store values using for loop, handling array overflow, increasing the size, print the values in array one by one.

#include<iostream>
using namespace std;
int main()
{
int sizea=0,counter=0;
char option;
cout<<"Enter the size of array"<<endl;
cin>>sizea;
int num[sizea];

try
{
while(counter<=sizea)
{
if(counter>=sizea)
{
 throw counter;
 break;
 }
cin>>num[counter];
counter++;
}
}
catch(int ct)
{
cout<&l"Reached max size do you want to continue adding\n If yes press any key, n to exit";
cin>>option;
if(option=='n')
return 0;
else
{
int newnum;
cout<<"Enter extension size for the array";
cin>>newnum;
num[sizea+newnum];
for(int k=ct;k<sizea+newnum;k++)
{
cin>>num[k];
}


for(int lo=0;lo<sizea+newnum;lo++)
{
cout<<num[lo];
}
}

}

return 0;
}