Question: Print Name: Fall 2016 CS5040 Test 1 (Chapter 15) Time: 60 mins Oct. 4, 2016 (Tuesday) 1. What is a copy constructor? Why is it
Print Name: Fall 2016 CS5040 Test 1 (Chapter 15) Time: 60 mins Oct. 4, 2016 (Tuesday) 1. What is a copy constructor? Why is it necessary to have a copy constructor when the class uses dynamie memory? (S points) 2. You have written a class with an operator + which is not a member function, but the operator implementation does access the private member variables of objects in the class. What do you need to do to gain this access? S points) 3. Give the output generated by the following code fragment. (5 points) int a -5: int b-3; int ma: int n b m+b n-m+b cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
