Here I am thinking ...
Why do I see much more often the use of #define
instead of enum
in other people's code when defining error codes for the return value of functions?
Is there a reason for this, or is it just a matter of taste?
As far as I know, enums are much more safer and debugger friendlier.
Asked
Active
Viewed 127 times
2

Brian Tompsett - 汤莱恩
- 5,753
- 72
- 57
- 129

Heeryu
- 852
- 10
- 25
-
Here are some C duplicates: [#define or enum?](http://stackoverflow.com/q/3134757/3425536) / [What makes a better constant in C, a macro or an enum?](http://stackoverflow.com/q/17125505/3425536) / [Why use enum when #define is just as efficient?](http://stackoverflow.com/q/5243269/3425536) – Emil Laine Nov 30 '15 at 23:39