if i take user input for the value of n.
int arr[n] will be static or dynamic ?
Static or dynamic?
Hey @vineethm1627
Its static allocation
Dynamic allocation can be done using new keyword or malloc function
For example
int *arr=new int[n];
//to access it same as normal array
for(int i=0;i<n;i++)cin>>arr[i];
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.