Today I read several articles about stack and stackArticleThe default size of the stack may be 1 MB or 2 MB. Try it with curiosity.
IntMain (IntArgc,Char* Argv[]){IntTMP[1000*256*2+1000* 3]={0};
}
It's about M. If it's bigger, it will appear.
5 [main] Test 3204 handle_exceptions: exception: status_stack_overflow 28408 [main] Test 3204 open_stackdumpfile: dumping stack trace to test.exe. stackdump
The environment is slickedit + GCC.
You can also do this:
IntMain (IntArgc,Char* Argv[]){IntI;IntJ;Printf("I address % P/R/N", & I );Printf("J address % P/R/N", & J );
}
result:
I address 0x23eef4j address 0x23eef0
I and j are local variables allocated in the stack. The allocation starts from the top of the stack. So the address of I is the top of the stack.
23eef4 to 0 indicates the size of the entire stack, it's about 2.3m. we can also see that
stack allocation is from high address (stack top) to the lower address, so The J address is smaller than the I address.