The following short definitions explain C++ terminology used in this chapter and in the rest of the book, as well.
Table 2.1 C++ Terminology
Term | Meaning |
Declaration | A declaration introduces names and their types into a program without necessarily defining an associated object or function. However, many declarations do serve as definitions. |
Definition | A definition provides information that allows the compiler to allocate memory for objects or generate code for functions. |
Dereference | Dereferencing converts a pointer value to an r-value. |
Lifetime | The lifetime of an object is the period during which an object exists, including its creation and destruction. |
Linkage | Names can have external linkage, internal linkage, or no linkage. Within a program (a set of translation units), only names with external linkage denote the same object or function. Within a translation unit, names with either internal or external linkage denote the same object or function (except when functions are overloaded). (For more information on translation units, see Appendix A, “Phases of Translation.”) Names with no linkage denote unique objects or functions. |
Name | A name denotes an object, function, set of overloaded functions, enumerator, type, class member, template, value, or label. C++ programs use names to refer to their associated language element. Names can be type names or identifiers. |
Object | An object is an instance (a data item) of a user-defined type (a class type). The difference between an object and a variable is that variables retain state information, whereas objects may also have behavior. |
This manual draws a distinction between objects and variables: “object” means instance of a user-defined type, whereas “variable” means instance of a fundamental type. | |
In cases where either object or variable is applicable, the term “object” is used as the inclusive term, meaning “object or variable.” | |
Scope | Names can be used only within specific regions of program text. These regions are called the scope of the name. |
Storage class | The storage class of a named object determines its lifetime, initialization, and, in certain cases, its linkage. |
Type | Names have associated types that determine the meaning of the value or values stored in an object or returned by a function. |
Variable | A variable is a data item of a fundamental type (for example, int, float, or double). Variables store state information but define no behavior for how that information is handled. See the list item “Object” above for information about how the terms “variable” and “object” are used in this manual. |