Home Segments Index Top Previous Next

147: Mainline

In Segment 129, you learned that a declaration is a program element that provides a compiler with information or advice, whereas a definition causes the compiler to allocate storage. Class definitions may or may not cause storage to be allocated. Accordingly, some purists prefer to use the phrase class declaration unless storage actually is allocated. Nevertheless, the declaration–definition distinction tends to be blurred when programmers talk about classes, and the phrase class definition tends to be used whether or not storage is allocated.