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 #include using namespace std;
class Base
{ string s; public:
Base() { s=”Sample text”;} Base(string s) { this?>s=s; }
void Print() { cout << s; } }; int main() { Base *o = new Base(); o?>Print(); }
A. It prints: Sample text
B. It prints: Sample
C. It prints: text
D. None of these

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.