A static variable is a variable that is allocated for the entire lifetime of the program. Its value is preserved between function calls or, if it's a class member, it is shared among all instances (objects) of that class.
Key properties:
Lifetime: It exists from the start of the program to its end.
Initialization: It is initialized only once, usually to zero by default if not explicitly initialized.
Scope: If defined inside a function, its scope is local, but its value persists. If defined as a class member, it belongs to the class itself, not to individual objects.