In order to be compatible with ANSI C, C++ allows the keyword struct in exactly the way that C allows - to define compound types. However, the internals of a struct are extended to make it identical to the class except in one respect. In a class, the default access control is private, whereas in a struct, the default access control is public. Everything else: data members, function members, constructors, destructors, overloading, operators etc. is the same.
Copyright © 2003 Roger Hartley