Question 1#
Which of the following statements about the program below is true?
Statement |
True |
|---|---|
The output of the program, when called, is begin main
Foo()
end main
~Foo()
|
Statement |
True |
|---|---|
The output of the program, when called, is begin main
Foo()
~Foo()
end main
|
#include <iostream>
class Foo
{
public:
Foo() {
std::cout << "Foo()" << std::endl;
}
~Foo() {
std::cout << "~Foo()" << std::endl;
}
};
int main()
{
std::cout << "begin main" << std::endl;
Foo f;
std::cout << "end main" << std::endl;
return 0;
}