Question: Write an example in C++ of a class Point with two fields for storing an x and a y coordinate pair. Write a constructor that

Write an example in C++ of a class Point with two fields for storing an x and a y coordinate pair. Write a constructor that uses an initialization list. Include an example of instantiating this class on the stack, and an example of instantiating this class on the heap. Indicate where both instances are cleaned up and have their destructor called. Draw a small diagram of both examples.

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!