Question
1.
#include
2.
using namespace std;
3.
class BaseClass
4.
{
5.
public:
6.
virtual void myFunction()
7.
{
8.
cout myFunction();
39.
return 0;
40.
}
What is the output of this program?
1.
#include
2.
using namespace std;
3.
class BaseClass
4.
{
5.
public:
6.
virtual void myFunction()
7.
{
8.
cout myFunction();
39.
return 0;
40.
}
Answer: Option A
Was this answer helpful ?
We are passing the objects and executing them in a certain order and we are printing the program flow.
Output:
$ g++ des3.cpp
$ a.out
123
Was this answer helpful ?
Submit Solution