Vidyalelo
C++ Programming · Q445

C++ miscellaneous

Programming · C++ Programming · question 445

Q445

What will be the output of the following C++ code? #include using namespace std; class BaseClass public: virtual void myFunction() cout myFunction(); p = &derivedObject1; p -> myFunction(); p = &derivedObject2; p -> myFunction(); return 0;

A.
123
Answer
B.
12
C.
213
D.
321

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board