A data object is a region of storage that contains a value or group of values. Each value can be accessed using its identifier or a more complex expression that refers to the object. In addition, each object has a unique data type. The data type of an object determines the storage allocation for that object and the interpretation of the values during subsequent access. It is also used in any type checking operations. Both the identifier and data type of an object are established in the object declaration.
An instance of a class type is commonly
called a class object. The individual class
members are also called objects. The set of all member objects comprises
a class object.
Data types are often grouped into type categories that overlap, such as:
The following matrix lists the supported data types and their classification into fundamental, derived, scalar, and aggregate types.
| Data object | Basic | Compound |
Built- in |
User- defined |
Scalar | Aggregate |
|---|---|---|---|---|---|---|
| integer types | + | + | + | |||
| floating-point types | + | + | + | |||
| character types | + | + | ||||
| Booleans | + | + | + | |||
| void type | +1 | + | + | |||
| pointers | + | + | + | |||
| arrays | + | + | + | |||
| structures | + | + | + | |||
| unions | + | + | ||||
| enumerations | + | + | see note2 | |||
classes |
+ | + | + | |||
| typedef types | + | + |
The C standard does not classify
enumerations as either scalar or aggregate.
Standard
C++ classifies enumerations as scalars.Related information