accessing enum members

AheaderFile.h is something like this;

1
2
3
4
5
6
7
8
class Fruits : public CompositeFruits { 

public:

enum FruitType {
   apple 
   banana
};



in my code, I include the header file;

 
#include AheaderFile.h 


the question is, how can I access the members of enum ?

thanks
Fruits::apple or similar. enums export their data to the surrounding scope.
If I do Fruits::apple, then it says


error: 'Fruits' has not been declared


?
apple and banana should be seperated by commas and you forgot the ending }; for the enumeration
Last edited on
it works now. thanks.


Topic archived. No new replies allowed.