Question
1.
#include
2.
using namespace std;
3.
class Base
4.
{
5.
public:
6.
int m;
7.
Base(int n=0)
8.
: m(n)
9.
{
10.
cout
What is the output of this program?
1.
#include
2.
using namespace std;
3.
class Base
4.
{
5.
public:
6.
int m;
7.
Base(int n=0)
8.
: m(n)
9.
{
10.
cout
Answer: Option A
Was this answer helpful ?
Answer:a
Explanation: In this program, We are printing the execution order of the program.
Output:
$ g++ der2.cpp
$ a.out
Instantiating Base
Base
Instantiating Derived
Base
Derived
Was this answer helpful ?
More Questions on This Topic :
Question 4.
Where is the derived class is derived from?
....
Question 5.
Pick out the correct statement.
....
Submit Solution