RAD Studio |  |

Class Types
See Also
Collapse All

The declaration creates a unique type, class type class-name. This lets you declare further class objects (or instances) of this type, and objects derived from this type (such as pointers to, references to, arrays of class-name, and so on):

Copy Code

    class X { ... };
    X x, &xr, *xptr, xarray[10];
    /* four objects: type X, reference to X, pointer to X and array of X */
    struct Y { ... };
    Y y, &yr, *yptr, yarray[10];
    // C would have
    // struct Y y, *yptr, yarray[10];
    union Z { ... };
    Z z, &zr, *zptr, zarray[10];
    // C would have
    // union Z z, *zptr, zarray[10];

Note the difference between C and C++ structure and union declarations: The keywords struct and union are essential in C, but in C++, they are needed only when the class names, Y and Z, are hidden (see Class name scope)

See Also

C++ Classes

Class Scope

Class Objects

Class Member List

Member Functions

The Keyword This

Static Members

Inline Functions

Member Scope

Nested Types

Member Access Control

Base And Derived Class Access

Virtual Base Classes

Friends Of Classes

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!