March 2019
Intermediate to advanced
708 pages
17h 9m
English
In the following code, we declare a simple Object class, then construct an instance of it using the new operator:
class Object { Object() { puts( "Object constructed" ); } ~Object() { puts( "Object destructed" ); } }; // Invokes constructor Object * object = new Object(); // Invokes deconstrctor delete object; // resets object to a null pointerobject = 0;
Read now
Unlock full access