I tried this code:
Code: Select all
int main(int argc, char *argv[])
{
int n;
scanf("%d",&n);
int vector[n];
}
I'm using dev-cpp on Windows Vista ( gcc (GCC) 3.4.2 (mingw-special) )
( looking the asm code I could see that it does it by calling alloca() )
What I want to know is if this kind of memory allocation is allowed by ANSI C?
And, is there any other kind of stack dynamic memory allocation?