473,465 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

regarding nested enums

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

Dec 6 '06 #1
3 4057

sa*****@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...

Dec 6 '06 #2
sa*****@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.

Dec 6 '06 #3

santosh wrote:
sa*****@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.

Dec 6 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: SpaceCowboy | last post by:
I recently got into a discussion with a co-worker about using enums across a dll interface. He wanted to use chars instead, argueing that depending on compiler settings the size of an enum could...
2
by: Faisal | last post by:
Can anyone tell me if it is possible to enumerate through all the Enums within a class . I have a class with many Enums and would like to accees the Enums through an array/collection etc. I can't...
3
by: Rubén Campos | last post by:
Organizing classes, types, structures, enums and whatever other entities into nested namespaces requires to include into every header and implementation file the complete path of namespaces. Let me...
2
by: a | last post by:
Is it possible to do a nested enum? For example, private enum inside0{a,b,c} private enum inside1{d,e,f} private enum outside{inside0, inside1} outside _variable=outside.inside0.a; //error...
7
by: Kurt | last post by:
Hi. I have a c++ project that is basically a set of implementation hiding classes, so that we can convert a static lib with a lot of dependancies into a dynamic lib with less dependancies, so that...
1
by: Nike | last post by:
I have a small question w.r.t nested class.. I see in many codes nested classes are declared as public.. First, of all my understanding is that you go in for a nested class if you are sure that...
2
by: onlymukti4u | last post by:
Hi, I am facing a problem for the allignment of the submenus under same line with the menu. Actually after clicking the menus the submenus should come exactly under same line with the menu but it...
1
by: onlymukti4u | last post by:
Hi, I am facing a problem for the allignment of the submenus under same line with the menu. Actually after clicking the menus the submenus should come exactly under same line with the menu but it...
3
by: Michel Esber | last post by:
Hi all, DB2 V8 LUW FP 15 There is a table T (ID varchar (24), ABC timestamp). ID is PK. Our application needs to frequently update T with a new value for ABC. update T set ABC=? where ID...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.