I have been reading some tutorials and books on c++ and I noticed that the authors almost always place an enum declaration outiside a class declaration, but dont explain why.
So I guess my question is: Is it better to do it this way instead of putting the enum inside the class declaration?Code:CPerson.h enum PersonState { PersonAwake = 1, PersonHungry = 2, PersonTired = 3, PersonAsleep = 4 }; class CPerson { public: // Person methods private: // Person members };



LinkBack URL
About LinkBacks



