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
When you write const double m=3000; you are telling the compiler to create a symbol m in the object file that can be accessed from other files. The compiler may inline the value of m in the file where it is defined, but the symbol still has to be allocated for the purposes of separate compilation.
When you write #define m 3000 you are just using a syntactic convenience for writing the same constant in several places in the source file.