You are viewing a single comment's thread. Return to all comments →
Can someone explain why I need to use :
int *arr = malloc(n*sizeof(int));
instead of:
int arr[n];
Where is the difference and what advantage do I gain from it ? Thank you in advance!
Seems like cookies are disabled on this browser, please enable them to open this website
1D Arrays in C
You are viewing a single comment's thread. Return to all comments →
Can someone explain why I need to use :
int *arr = malloc(n*sizeof(int));
instead of:
int arr[n];
Where is the difference and what advantage do I gain from it ? Thank you in advance!