I\'ve read that static variables are used inside function when one doesn\'t want the variable value to change/initialize each time the function is called. But what about def
#define is a preprocessor operation and will cause all occurrences of m to be replaced by 30000 before the compilation phase happens. The other two examples are bona fide variables. The static variable exists in the translation unit in which it is declared and can be modified. The const variable is read-only.