Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
586 Discussions

What is the executable code for run-time polymorphism?

AnkitTech
Beginner
440 Views

class Base {
public:
virtual void show() { cout<<" In Base \n"; }
};
class Derived: public Base {
public:
void show() { cout<<"In Derived \n"; }
};

int main(void) {
Base *bp = new Derived;
bp->show();
return 0;
}

0 Kudos
0 Replies
Reply