Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C only
Search
Advanced Search
Forums
Product Launch
Updates
Today's Posts
Member List
Calendar
Home
Forum
Topic
C
What is the difference between Enum and Static Enum in C++ ?
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
JyotiranjanR
New Member
Join Date:
Jul 2010
Posts:
1
#1
What is the difference between Enum and Static Enum in C++ ?
Jul 29 '10, 10:08 AM
Hi all,
I wanted to know, What is the difference between Enum and Static Enum in C++ ?
Thanks.
weaknessforcats
Recognized Expert
Expert
Join Date:
Mar 2007
Posts:
9214
#2
Jul 29 '10, 05:23 PM
enum is not a type.
An enum is a list of named integer values:
Code:
enum Color = {RED, BLUE, GREEN};
You can create variables wit the enum name rather than the value:
Code:
enum Color Data = BLUE;
At this point Data is an int with a value of 1.
Therefore a static enum Color is just a static int.
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment