Question: Write a C++ class, MyClass, that has tree member variable of type int, long, and float, respectively and one of them should use dynamically memory

Write a C++ class, MyClass, that has tree member variable of type int, long, and float, respectively and one of them should use dynamically memory allocation as learned in the class.
a. Your class must include three different type of constructor functions learned in the class.
b. Your class should include functions for setting the value of each type, getting the value of each type, and computing and returning the sum of each possible combination of types.
c. Implement overloaded assignment operator as one of class member functions.
d. Your class must include destructor function which takes care of dynamically
allocated members reside in heap space.
e. Test every feature (copy constructor, overloaded assignment operator, etc.) to
verify correctness of your code.

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!