regarding nested enums

S

sam_cit

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 ;-)
 
M

mark_bluemel

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...
 
S

santosh

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.
 
T

Tom St Denis

santosh said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

passing enums through stdarg 3
Copy string from 2D array to a 1D array in C 1
Fixing "typos" in enums... 18
enums ain't no good 12
Creating a vector of queues 2
enums clash 9
Nested enums 5
enums 6

Members online

Forum statistics

Threads
474,261
Messages
2,571,040
Members
48,769
Latest member
Clifft

Latest Threads

Top