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
If the value of m has to stay the same forever, then of course you can either use
static const double m = 30000;
or
#define m 30000
Just note that in C const objects have external linkage by default, so to get the equivalent const declaration you have to use static const, not just const.
Also note that in C language const objects are not constants, but rather "constant variables". If you need a true constant (i.e. an entity that forms constant expressions), you have to use either #define or enum constant.
The latter is normally an issue with integral constants only. In your case of a double the approach with [static] const might work best.