Question: 1. (2 points) Consider a class called Foo and the code in the main function Foo z;. When the above piece of code is executed,
1. (2 points) Consider a class called Foo and the code in the main function "Foo z;". When the above piece of code is executed, the following text is displayed: "Hello Foo!". Where does the code to display the above text go? Constructor? Destructor? Member function? Main program? Friend function? Others? 2. (5 points) Following the above question, assume a destructor that is part of Foo which prints "Bye Foo!". Consider the following user program. What is the output? void testFoo; int main)f Foo j; testFoo); Foo k; return 1; void testFoo )1 Foo t cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
