I heard that statics and globals are stored in the same section. And if that's not true, like global variables static locals won't be removed from memory till code is unloaded or program exits.
Consider the following code:
void f1() {
static int i;
...
...
}
void f2() {
static int i;
...
...
}
if both i's are in same section, how will processor differentiate between them?
And how does processor load corresponding static locals when a function is called?
This question can be extended to multi-file global-static variables.