#include using namespace std; // shape == 0, sphere == 1, cylinder == 2, polygon == 3 enum Forms { shape, sphere, cylinder, polygon }; // point2d == 2, point2w == 3, point3d == 3, point3w == 4 enum Points { point2d = 2, point2w, point3d = 3, point3w }; int main(void){ Points pt3d = point3d; // ok: pt3d == 3 Points pt2w; // error: pt2w initialized with int // pt2w = 3; // error: polygon is not a points enumerator // pt2w = polygon; // ok: both are objects of Points enum type pt2w = pt3d; // prints out the integer value assoicated with the enumerator cout << pt3d << ' ' << pt2w << ' ' << point3d << endl; return 0; }