The static vars in a program exists in the memory for all the execution time while the static vars of a subprogram are created (by invocations to the subprogram) and destroyed (by termination of the subprogram) which is done by pushing of the subprogram's activation record onto and popping of it off the program's function call stack, but:
What about the static vars in blocks(I mean control structures or any {} block) inside the main program? They aren't accessible outside their blocks where they are defined, How is memory concept for them?
Are they exist in the memory in the whole program execution but aren't accessible outside their blocks or there are activation records also for every block other than subprograms?