Intel® oneAPI Data Parallel C++
Support for Intel® oneAPI DPC++ Compiler, Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and GDB*
398 Discussions

What is the executable code for run-time polymorphism?

AnkitTech
Beginner
221 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