Question: In C++ Make a class, it needs to have a constructor and destructor. The constructor should say Constructor is running, Destructor should say Destructor is

In C++

Make a class, it needs to have a constructor and destructor. The constructor should say "Constructor is running", Destructor should say "Destructor is running".

Then, instantiate that class locally and dynamically and with a smart pointer.

====

In other words -- create 1 class with a header file and a cpp file. The class has a constructor and destructor as described above.

In another file, in your main function, create 3 variables that are of that class type. One of the variables/objects is created locally, another is created dynamically and the last is created with a smart pointer.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!