Is memory allocated at runtime for the static variables?
No. Static memory is allocated at compile time. Static variables
are allocated within the program's data segment which is a physical
part of the executable. When you load the executable into memory,
the operating system sets aside enough memory for the entire
executable and copies it, byte for byte, into that memory. So when
the program is executed, the data segment is already allocated.