enum

can you include enum in a header file
A header file is usually the right place for and enum.
you can include the enum in the header file in the source file , inside the class .
eg :

// In the class we have
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Car
{
private:
         Color _color;

      public: 
                enum Color
                  {
                           RED,
                           WHITE,
                            BLUE
                    };
void SetColor( Color color);

};
Last edited on
Topic archived. No new replies allowed.