Home Segments Index Top Previous Next

707: Sidetrip

Given the rules for declarations and definitions, you now can reflect a bit on how class definitions are distributed between header files and source-code files.

In particular, note that a class definition without internally defined member-function definitions is more properly called a declaration, because such a definition tells the C++ compiler what memory to allocate when an object belonging to the class is created, but it does not actually allocate any memory. Accordingly, the proper place for such a class definition is a header file.