I\'m coming back to some C development after working in C++ for a while. I\'ve gotten it into my head that macros should be avoided when not necessary in favor of making the com
A const int MY_CONSTANT = 7;
will take up storage; an enum or #define
does not.
With a #define
you can use any (integer) value, for example #define IO_PORT 0xb3
With an enum you let the compiler assign the numbers, which can be a lot easier if the values don't matter that much:
enum {
MENU_CHOICE_START = 1,
MENU_CHOICE_NEXT,
...
};