What is the point of an enum being used for something like a switch statement when you then have to cast them to ints?
Isn’t it just better to use a few const ints? I want to use enums but the cast makes them seem clunky. I thought they were meant to be ints but they’re something else?
Do they have the same behaviour in C++?
sorry for the badly worded question, my brain is fried.
The entire point of enums are to make your code more readable. They are not casted to ints, since they are by default ints. The only difference is instead of going back and forth checking what int values you may have, you can have a clear set of enums to make the code more readable.