Skip to content

The "Obj" Data Type

Brandon Barber edited this page Aug 20, 2017 · 1 revision

"obj" and "struct" data types are very similar to each other.

The main difference is that an object can have default values.

For example:

obj Box {
    int width = 1;
    int height = 2;
    int depth = 3;
}

To create an object you use "new"

For example:

Box *myBox = new Box;

If we wanted to create an array of Boxes of length 10, we would do the following.

Box **myBoxes = new Box*10;
Clone this wiki locally