Definition, Construction, and Destruction

Get to learn about the definition, construction, and destruction of class objects.

We'll cover the following

Definition

Classes are defined by the class keyword instead of the struct keyword:

class ChessPiece {
    // ...
}

Construction

As with structs, the name of the constructor is this. Unlike structs, class objects cannot be constructed by the { } syntax.

Get hands-on with 1000+ tech skills courses.