How to calculate the Stack Size?
I want calculate the used Stack Size..till now i did like this..my processor
assume my processor stack size is 8k bytes...
since i have three local variables stack consumed is 3 bytes so remaining stack size is=8k-3 bytes=1021 bytes
int m=0, n=0, sum=0;
Am i right?
Thanks for useful information...
Whatever you explained is only for main function..if i have functions in main..i mean every function call take how many stack bytes....Example
Originally Posted by matsp
8k=8*1024=8192-(8+6)=8178 bytes remaining..Am i right?
int add(int, int);
int m=10,n=20; /* it will take 2 *4 =8 bytes
printf("%d", add(m,n)); / * printf will take 4 bytes+ function call will take 2 bytes to store add
int add(int x, int y)
Logic to develop the code for finding stack size?
I Have Complex code in my project..i have to calculate the algorithm for that...i am trying to develop C program for that..Any body know the logic how can implement this?