According to c99 standard, we can write the following code and it's totally legal
int x;
scanf("%d",&x);
int ar[x];
My question is, if I can allocate an array like this, why would I ever need malloc to allocate variable size arrays again?
Also, could you please explain how does the variable length arrays allocation happens? Deep inside, does it call malloc to allocate the array or what?