I have a question regarding function calls. If function with variable(s) calls another one, which calls another one ...etc, like a chain of function calls. Where and how are the memories(of variable for instance) stored/managed for each function calls? Are they stored in a single stack automatically? thank you very much in advance.
example code:
Code:
int func1 (int x){
int a = x;
a += func2(x);
return a;
}
int func2 (int x){
int a = x;
a += func3(x);
return a;
}
int func3 (int x){
int a = x;
a += func4(x);
return a;
}
and so forth...
PS: I'm new to programming, just taking interest lately