3 ms·
You have to understand where enums originally came from. Initially they were simply #defines in the pre-processor to make code easier to read. Instead of having
by UltraViolence 4y ago
You have to understand where enums originally came from. Initially they were simply #defines in the pre-processor to make code easier to read. Instead of having "magic numbers" all over your code you'd have something that kinda made sense.
Then they became part of the C language when they evolved into enums but still remained compatible with int's (you could cast an enum to an int).
In that mindset it never occurred to anyone that an enum could have an "internal" value too.