![]() |
| ||
| multiple enums problem enum MenuOptionInitial { TEST_ONE = 1, TEST_TWO, TEST_THREE};the problem is that i want to have another selection base on other options i.e. what can i do , for this to work?? i want to have multiple enums...is it possible....??? I think that i could use namespaces to solve this problem{although i don't know how}...But i someone wanted to write to pure c {that doesn't have namespaces}, what would he do? |
| ||
| Re: multiple enums problem Why not use the first ENUM set for the second selection also ? Either that or prefix the ENUM names with an abbreviation of their purpose. Something like: enum MenuOne { MO_FIRST = 1, MO_SECOND } ; |
| ||
| Re: multiple enums problem As long as both enums are NOT used within same switch-case there are no issues at all.. If you wish to use them in same switch-case you'll get the err that case value is repeated. So all you gotta do is decide on 2 ranges for both your enums and change the first value in enum declaration appropriately. E.g. const ENUM_ONE_START = 0 ; |
| ||
| Re: multiple enums problem Quote:
|
| All times are GMT -4. The time now is 12:28 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC