struct Base {
virtual void draw( Color Col = RED ) {
// draws square of Col color
}
};
struct Derived : Base {
virtual void draw( Color Col = GREEN ) {
// draws circle of Col color
}
};
// ... polymorphic method call
Base * B = new Derived;
B -> draw();
Login in to like
Login in to comment