regarding nested enums

  • Follow


Hi Everyone,

 I have a enum in my program to represent country names and i would
like to have enums within the same to represent state within the
countries, i tried to create one similar to nested structure but i
landed up with compiler errors, if it is not possible, please let me
know any other alternatives that will help.

Thanks in advance ;-)

0
Reply sam_cit (402) 12/6/2006 8:32:32 AM

sam_cit@yahoo.co.in wrote:
> Hi Everyone,
>
>  I have a enum in my program to represent country names and i would
> like to have enums within the same to represent state within the
> countries, i tried to create one similar to nested structure but i
> landed up with compiler errors, if it is not possible, please let me
> know any other alternatives that will help.

I suggest you start by showing us a small program illustrating what you
tried to do and what compiler errors resulted from it. Then we've
something more concrete to discuss...

0
Reply mark_bluemel (848) 12/6/2006 2:11:18 PM


sam_cit@yahoo.co.in wrote:
> Hi Everyone,
>
>  I have a enum in my program to represent country names and i would
> like to have enums within the same to represent state within the
> countries, i tried to create one similar to nested structure but i
> landed up with compiler errors, if it is not possible, please let me
> know any other alternatives that will help.

One possible way is to have seperate enums for countries and states,
but bundle each complementary pair into a structure.

0
Reply santosh.k83 (3969) 12/6/2006 2:17:44 PM

santosh wrote:
> sam_cit@yahoo.co.in wrote:
> > Hi Everyone,
> >
> >  I have a enum in my program to represent country names and i would
> > like to have enums within the same to represent state within the
> > countries, i tried to create one similar to nested structure but i
> > landed up with compiler errors, if it is not possible, please let me
> > know any other alternatives that will help.
>
> One possible way is to have seperate enums for countries and states,
> but bundle each complementary pair into a structure.

Finite State Machine.

Make a lexer that accepts whole words as symbols.

Tom -- inventing homework problems more complex than the original since
9:53am this morning.

0
Reply tomstdenis (355) 12/6/2006 2:53:48 PM

3 Replies
43 Views

(page loaded in 0.315 seconds)


Reply: