|
-
Apr 16th, 2002, 12:12 AM
#1
Thread Starter
Frenzied Member
Enumerated VARs
Someone asked me about what these were, and for the life of me I can't come up with a good, easy to understand explanation. Someone care to help me out on this one?
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Apr 16th, 2002, 05:52 AM
#2
Do you mean enums?
An enum is a collection of integer constants which are bound logically and (in C++) semantically together.
enum Animals
{
Dog,
Cat,
Mouse,
Horse,
Elephant,
// ...
};
enums are typesafe only on C++:
Animals a = Cat;
int i = a; // needs typecast in C++, not in C
enums are real constants only in C++, the following is invalid in C:
switch(a)
{
case Dog:
break;
case Cat:
break;
}
I'll add if I come up with other things.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|