You are viewing a single comment's thread. Return to all comments →
For example here, the size of the array cannot be declared using a general array declaration.
Instead the array size has to read during run time, after array size is known using:
int k; cin>>k;
During the run time array declaration is dynamically made and a array size of 'k' is made using
int* i_arr = new intk;
which means a pointer which points at i_arr[0] and has a size of i_arr[k].
Seems like cookies are disabled on this browser, please enable them to open this website
Variable Sized Arrays
You are viewing a single comment's thread. Return to all comments →
For example here, the size of the array cannot be declared using a general array declaration.
Instead the array size has to read during run time, after array size is known using:
int k; cin>>k;
During the run time array declaration is dynamically made and a array size of 'k' is made using
int* i_arr = new intk;
which means a pointer which points at i_arr[0] and has a size of i_arr[k].