function overriding in C++

Function overriding occurs when a derived class has a definition for one of the member functions of the base class. That base function is said to be overridden. 
```
#include <bits/stdc++.h>
using namespace std;
 
class base
{
public:
    virtual void print () { cout<< "print base class" <<endl; }
     void show () { cout<< "show base class" <<endl; }
};
  
class derived:public base
{
public:
    void print () { cout<< "print derived class" <<endl; }
    void show () { cout<< "show derived class" <<endl; }
};
 
int main()
{
    derived d;
    base *bptr;
    bptr = &d;
      
    bptr->print(); // print derived class
    bptr->show(); // show base class
 
    return 0;
}
```