I would like to know how is the run-time stack handled when running the code below
int i;
for (i = 0; i < 100; i++) {
int v[i+1];
...
}
Stack is reduced and grown after every loop ? Stack is initially allocated by an amount which will fit v[101] ? Is it optimized by compiler so it treats v as a pointer and do only heap allocations ?
Thanks.
int v[i+1];is a VLA declaration.