I'm trying to understand static keyword by having a deeper look at the memory layout, but i'm quite confused with the static method/function.
#include <iostream>
void staticFunction () {
int a = 10; //this variable would be in the stack
}
static void staticFunction1 () {
int a = 20; //if this static function is called, what part of the memory does content variables is it stored? is it in still in the stack?
}
int main () {
staticFunction(); //this function is created in the stack which then creates a stack frame
staticFunction1();
return 0;
}
This is how i visualize what the memory layout for int main would look like, which one is correct?