Thursday 15 March 2012

C++ enum syntax -


after declaring

  enum color {red, blue, green};   

There is a difference between

  color a = blue;   

and

  enum color A = blue;    

  MyEnumType {ALPHA, BETA, GAMMA}; Enum MyEnumType x; / * Legal in both C and C ++ * / MIME type; // Only in legal C ++ enum {HOMER, MARGE, BART, LISA, MAGGIE};    

No comments:

Post a Comment