It must be allocated at runtime. Consider the following:
void a( void ) { int x; } void b( void ) { int y; a(); } int main( void ) { a(); b(); }
The address of the local stack element in a () will be different between its two calls. As blinkenlights note, the layout of each frame of the function stack is largely determined at compile time, but the location of this frame is determined at run time.
Russell Borogove
source share