I found enum be defined like this and can't figure it out why they put leading zero there.
enum SquareDelta { DELTA_SSW = -021, DELTA_SS = -020, DELTA_SSE = -017, DELTA_SWW = -012, DELTA_SW = -011, DELTA_S = -010, DELTA_SE = -07, DELTA_SEE = -06, DELTA_W = -01, DELTA_ZERO = 0, DELTA_E = 01, DELTA_NWW = 06, DELTA_NW = 07, DELTA_N = 010, DELTA_NE = 011, DELTA_NEE = 012, DELTA_NNW = 017, DELTA_NN = 020, DELTA_NNE = 021 };
I guess this is not just normal int enum but what is it? could it be in hex like number beginning with "0x" ?
Enumeration or Enum in C is a special kind of data type defined by the user. It consists of constant integrals or integers that are given names by a user. The use of enum in C to name the integer values makes the entire program easy to learn, understand, and maintain by the same or even different programmer.
They Lack Accountability. To be clear, it's a mistake to assume consensual non monogamy is void of commitment. It's not simply informing your casual hookup of your other casual hookups. For a lot of people, it's being communicative to their partner of what they're doing with their friend with benefits or boyfriend.
An enum is a data type that contains fixed set of constants. An enum is just like a class , with a fixed set of instances known at compile time. Advantages of enum: enum improves type safety at compile-time checking to avoid errors at run-time.
Those numbers are octal constants. (Numbers leading with 0
but not 0x
are considered in base-8).
Thus, -021 == -17, -020 = -16, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With