Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例如:
enum ABC { apple = 0xe, banana = 0xd, orange, pineapple }
可以orange自动获取和的值0xc吗pineapple 0xb?
orange
0xc
pineapple
0xb
不,这些值只能自动递增。如果您希望值相反,则可以颠倒名称的顺序。
enum ABC { pineapple = 0xb, orange, banana, apple };