There are two types of static : static in the global scope in the file and static inside the function.
The first declares an internal binding for the object, which means that it is available only inside the file. These objects are created in bss before entering main() . This memory area is always memset for all zeros until main() run.
The default value for objects created by an external functional area is global (external connection), that is, they can be accessed from other compilation units using the extern keyword.
static inside a function means that the object exists the first time the function is called before the program terminates.
Illustration:
int external_linkage; static int internal_linkage; void foo() { static int static_in_function; }
When the program starts, the value 0 guaranteed in all three variables, unlike the stack and heap variables.
Lstor source share