int main(){ int n; cin>>n; int arr[n]={0};} here the array size is decided at the run time so is this dynamic? if not then why do we need dynamic memory allocation if we can do this while the runtime?
What type of memory allocation is: int array[n];
It is actually static memory allocation (since they are kept in stack memory).
You can find your answers here
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.