Question: Please explain: What has been achieved in terms of functionality, i.e what action/call or operation can I perform after dynamic casting? Do Base*b or Derived*

Please explain:

What has been achieved in terms of functionality, i.e what action/call or operation can I perform after dynamic casting?

Do Base*b or Derived* d have become more capable in any sense?

Please explain any thing that I is achieved after dynamic cast and was not possible otherwise.

Please explain: What has been achieved in terms of functionality, i.e what

code for ref:

#include

using namespace std;

class Base {

public:

virtual void print() {}

};

class Derived : public Base {

public:

void print2(){

cout

}

};

int main() {

Base* b = new Derived;

Derived* d = dynamic_cast (b);

if (d != NULL) {

cout

}

else {

cout

}

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!