Question: In the following C++ program, indicate the 8 outputs produced. If the code contains any bugs, point them out in the code and explain why.


In the following C++ program, indicate the 8 outputs produced. If the code contains any bugs, point them out in the code and explain why. class show \} public: void alter() { cout alter(); // Output 1: firstPtr >bank() II Output 2: thirdPtr->bank(): I/ Output 3: secondPtr->change(): I/ Output 4 : secondPtr > dock(); II Output 5: live * fourthPtr, * fifthPtr, " sixthPtr; fourthPtr = new show (); fifthPtr = new live(); sixthPtr = new opera(); sixthPtr->alter(); // Output 6: fifthPtr->change(); // Output 7 : sixthPtr->dock (); // Output 8: \}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
