C++ Class Name Declaration Bob Walton, 7/16/96 A C++ `class' may be defined by a struct declaration: struct foo { ... }; In C++ this implies: typedef struct foo foo; That is, `struct foo { ... };' defines a new type name `foo' without any additional declarations, in C++, but not in C. The enum declaration is similar: enum foo { ... }; In C++ this implies: typedef enum foo foo; In C++ an enum type is somewhat like a class and somewhat unlike a class. An enum type is like a class in that it is a distinct type, and is not the same as any other type, specifically `int'. A C++ class may also be defined by: class foo { ... }; which of course implies: typedef class foo foo; The difference between struct and class has solely to do with the public and private access control mechanisms. If you do not yet know about access control mechanisms, always uses `struct', and never use `class'.