I am trying to understand the layout of the stack and how memory is allocated.
I have the following program and I want to know the starting address of the buffer array, if suppose the stack starts at address 12000 (for instance).
void function( int a, int b ) {
char buffer[ 512 ];
}
void main() {
function( 1, 2 );
}
function). There's nothing in standard C that will let you calculate that address, it's completely compiler/platform dependent.bufferat all because it's unused. Or maybe it allocates it on the heap because it's Sunday, and because it can.