473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

typedef enum

Any comments on this construct ?

class testClass
{
public:
typedef enum
{
SOME_CONS0 = 0,
SOME_CONS1,
SOME_CONS2
} Type;
} ;
Jul 19 '05 #1
2 12764
qazmlp wrote:
Any comments on this construct ?
What exactly is your poblem with it?

class testClass
{
public:
typedef enum
The typedef doesn't hurt here, but it's not needed.
{
SOME_CONS0 = 0,
SOME_CONS1,
SOME_CONS2
I usually don't use identifiers in all uppercase for enums and rather
reserve them for preprocessor macros. I think that's a good idea, since
that turns preporcessor marco names into kind of a red flag. You lose
that if you use all uppercase names for anything else.
} Type;
} ;


Jul 19 '05 #2

qazmlp wrote:

Any comments on this construct ?


It's very bad FORTRAN, gaz.

regards,
alexander.
Jul 19 '05 #3

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

Similar topics

6
by: Fao | last post by:
Hi, I am in my first year of C++ in college and my professor wants me to Write a Program with multiple functions,to input two sets of user-defined data types: One type named 'Sign' declared by...
3
by: balor | last post by:
Sometimes it is useful to assign class names to types that are primitives even if they add no more functionality, at the very least to be able to determine which constants apply to a type: ...
4
by: Chris | last post by:
I've lurked around long enough... Time to interract =) I'm trying to make sense of the following. I can't quite wrap my head around what this is actually doing: ------------- typedef enum {...
30
by: stephen henry | last post by:
Hi all, I have a question that I'm having difficulty answering. If I have a struct: typedef struct my_struct_tag{ struct my_other_struct *other; } my_struct_tag
13
by: Martin | last post by:
This post asks two questions, which I've illustrated in one C source file (see below), which clean compiles on my GNU compiler. 1. In K&R2, Section A8.9 it says "Declarations whose storage class...
12
by: vvv | last post by:
Hi All, Do we have anything in .NET which is equivalent to C++'s Typedef . Regards, Vasanth
10
by: =?utf-8?b?QXNiasO4cm4gU8OmYsO4?= | last post by:
I came over this code which puzzled me. Isn't the enum supposed to have an identifier? enum { BT_CONNECTED = 1, /* Equal to TCP_ESTABLISHED to make net code happy */ BT_OPEN, BT_BOUND,...
4
by: msukumarbabu | last post by:
Hi all, What will be difference between "typedef enum" and "enum". or difference between “typedef structure" and "structure" I am going through some code. in that some place they are using...
3
by: wongjoekmeu | last post by:
Hello all, I was wondering what the differences are between these two things: 1) enum color { RED, BLUE }; and 2) typedef enum { RED, BLUE } color; Is there a difference anyway ? Why...
9
by: C_guy | last post by:
I noticed that typedef enum _myEnum { enum1 = 0, enum2, enum3, .....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.