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
Get step-by-step solutions from verified subject matter experts
