enum colour{red, blue, green}; //Declare the enumeration
class a
{
colour theColour; //Declare a variable of the type in the class;
...
}
a myInstance; //declare an instance of class
a.colour = red; //set varaible to one of the enumerations;
Hi,
I am Rammohan from Bangalore and working as a Technical lead in big IT firm . Solution for your answer is follows:
You can do write Enumaraters object in C++ class is follows:
1. class ArticleCollection : public IEnumerable
2. {
3. ...
4. public:
5. IEnumerator* GetEnumerator()
6. {
7. return dynamic_cast<IEnumerator*>(
8. new ArticleEnumerator(this));
9. }
10.
11. public:
12. __gc class ArticleEnumerator : public IEnumerator
13. {
14. };
15. ...
____________________
Regards, Rammohan Alampally,
rammohan@india.com
Technical Lead,
Bangalore, India.
[COLOR="Red"]www.FindSyntax.com -> Worlds first Web based Windows O/S is a Brain Chaild of Rammohan[/COLOR]
He has confused your request for information on enum, or 'enumerated types' with 'Enumerators'.
The purpose of enumerators is to 'enumerate' a list (IE to perform some action on each member of the list in turn) using the for each syntax.
I belive this may be specific to MS .Net extensions to C++. The code he has given is the older 'managed extensions' (VC++ 2003) rather than the newer C++/CLI (VC++ 2005 or 2008).