Re: Enum?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Alan F wrote:

>  From what I understand, the first entry in any 'enum' statement is always
> set to 1. 

Actually it turns out that this is not always the case. Consider ...

enum
   FAILURE = -1,
   OKAY
enum WM_USER = #0400,
     WM_NOTIFY,
     WM_DROPDOWN

In these cases, the first item is not 1.

There is also the case where a coder does this ...

enum 
   OPTA = 2,
   OPTB = 9,
   OPTC = 0,
   OPTD = 7

Here the 'first' one is 2, the 'minimum' one is 0, then 'number of values' is 4,
the 'last' one is 7 and the 'maximum' one is 9.

All these properties (okay maybe not first and last) are useful to know. 


-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu