According to the text, For Static memory allocation the size of the array should be known at the compile time.
but i have been using
int arr[n] for declaring an array where n is obviously unknown at the compile time .
why don’t I get an error for this statement?
Static memory allocation for an array using user input
you didn’t get error because
compiler give any random value(large) to n
which is fixed
but in dynamic memory allocation n is not fixed which save our memory