473,508 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

enumerated types

I want to define enuermated types to be use by other classes:

enum node_types
{
categories, no_sections, email
}

How do I make this to be accessed by other classes?

eg.
switch (aTypes)
{
case categories:
case no_sections:
case email:
default:
}
Jul 17 '06 #1
1 1316
Alan T wrote:
I want to define enuermated types to be use by other classes:

enum node_types
{
categories, no_sections, email
}

How do I make this to be accessed by other classes?

eg.
switch (aTypes)
{
case categories:
case no_sections:
case email:
default:
}
Hi Alan,

You need to define 'node_types' to be public (unless it's intentional that
they are internal):

///
public enum node_types
{
...
}
///

But, when using them, you also need to fully-qualify the enumeration name:

///
switch ( aTypes )
{
case node_types.categories:
...
break;

case node_types.no_sections:
...
break;
}
///

--
Hope this helps,
Tom Spink

Google first, ask later.
Jul 17 '06 #2

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

Similar topics

0
1082
by: David R. Throop | last post by:
How does one progressively restrict enumerated types in Owl? I've got an ontology of function-terms. I want to map English-language terms (as strings) to the function terms. I want to restrict...
2
3337
by: Simon Storr | last post by:
Posting this again as it just got deleted off the server?! Is it possible to perform an 'in' set operator check on an enumerated type? For example something like enum WeekDays =...
1
1159
by: SamIAm | last post by:
Hi There I need to record various error codes in my application. These error codes are from a 3rd party product that I get return codes from when I call their methods. They are stored as string...
0
1384
by: Martin | last post by:
I am currently writing a program and I am trying to create a property for a custom control that can be set a value of either 'linear' or 'traditional' in the properties window in design time from an...
0
1069
by: Brandon | last post by:
Hello all, and thanks for taking a look at this. First off, the project I am working on is a server/client application that contains a shared assembly of common classes between the two...
22
2105
by: Ben Finney | last post by:
Howdy all, I've recently packaged 'enum' in PyPI. In its description, I make the claim that it creates "immutable" enumeration objects, and that the enumeration values are "constant" values. ...
8
2177
by: ypjofficial | last post by:
Hi all, In what way does the enumerated data type contibute to the size of a class if its part of that class? eg. #include <iostream.h> class one { public:
4
4369
by: Shawnk | last post by:
This post is intended to verify that true value semantics DO NOT EXIST for the Enum class (relative to boolean operations). If this is true then (thus and therefore) you can not design state...
7
2605
by: John Goche | last post by:
Hello, The following program compiler and runs fine under gcc and produces the output 3. However, I am not sure whether such behavior is legal. In particular, as a related question, how would I...
1
1600
by: senfo | last post by:
I'm using an enumerated type to identify a record type that relates to a unique ID in a database. Identity columns in SQL start at 1, while enumerated types in C# start at 0. I didn't think it...
0
7342
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,...
1
7067
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
7505
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
5650
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5060
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
4729
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
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
440
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.