In my program in many classes I use Color as a type, and it should have only WHITE and BLACK as its possible values.
So for example I want to write:
Color c;
c = BLACK;
if(c == WHITE) std::cout<<"blah";
and similar stuff. In all my classes and headers I’ve said #include "ColorType.h", and I have Color c as class attributes, but I don’t know what to write in that ColorType.h. I’ve tried some variations of typedef enum Color but it didn’t quite work out.
1 Answer