Hey guys, I'm trying to learn more about exactly what C stores on the stack, what it stores on the heap and what is considered global data etc. So any help is greatly appreciated. For example:
This is a global variable (not inside a function). Would this be stored on the code/global data memory image section? Or would this go on the stack?
Another question:
Code:
int f(int b)
{
return b - x;
}
Is the variable b on the stack even though it's a formal parameter and not an actual? Or would it not be pushed onto the stack until used in the return statement of return b - x;?
Thanks for any help guys!