What happens when you attempt to compile and run the following code?

What happens when you attempt to compile and run the following code?
#include using namespace std;
www.vceplus.com – VCE Exam Simulator – Download A+ VCE (latest) free Open VCE Exams – VCE to PDF Converter – PDF Online
class A { public: virtual void Print()=0;
};
class B:public A { public: virtual void Print() { cout<< "B"; } }; class C:public A { public: virtual void Print() { cout<< "C"; } }; int main() { B ob2; C ob3; A *obj; obj = &ob2; obj>Print(); obj = &ob3; obj>Print(); }
A. It prints: BC
B. It prints: CB
C. It prints: CC
D. It prints: BB

Download Printable PDF. VALID exam to help you PASS.

Posted in: CPA

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.