Reputation: 1010
I know that I can declare a named compile-time constant in C for integers by using enums, but is there a way to declare named compile-time constants in C for floats as well, without using macros (I know that C++ has constexpr, but I am strictly using C right now)? Answers containing compiler-specific C-language extensions are also greatly appreciated.
Upvotes: 1
Views: 396
Reputation: 21
Use array of const float.
Which will produce constant data of type float.
const float *arr[3] = {11.21,21.31,31.23}
Upvotes: -1