Pretty much every C textbook I can think of now is full of #defines for constants. I, too, am (de)formed by this.
And `static const` by itself is not a good alternative, because constants can't be used in a lot of places, for example when declaring the size of an array.
The blog post was written with C++ in mind, but I just learned that C now also has constexpr: https://en.cppreference.com/w/c/language/constexpr.
Time to update those books (:
And `static const` by itself is not a good alternative, because constants can't be used in a lot of places, for example when declaring the size of an array.