CyberSlug Rules!

Beginner Programming CMPS060

Prof. Paulo Franca

Home

Syllabus

Login

Objects

Download

Staff only

enumerated constants

... are integer constants assigned sequentially to your identifiers

enum directions {N,E,S,W};

enum color(white,red,green,blue,lightblue,pink,yellow,black);

you may skip the increment...

enum(sunday,tuesday=2);

Notes:

  • in the above examples, directions and color become new types.
  • white and red are of type "color"
  • N is of type "directions"