Below code is not working. What could be the possible error?

class base {
public:
base() {
cout<<"Constructing base \n";
}
~base() {
cout<<"Destructing base \n";
}
};
 
class derived: public base {
public:
derived() {
cout<<"Constructing derived \n";
}
~derived() {
cout<<"Destructing derived \n";
}
};
 
int main(void) {
derived d;
base* b = d;
return 0;
}

base* initialization should be done using new operator
derived cannot be converted to base* in initialization
No error
None of the above
Verified Answer
Correct Option - b

To get all Infosys Certified CPP Programmer Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee

Telegram