In C++, method overloading and method overriding are two different features to support object-oriented programming.

Method overloading is the ability for functions of the same name to be defined as long as these methods have different signatures.

is the ability for functions of the same name to be defined as long as these methods have different signatures. Method overriding is the ability of the inherited class rewriting the virtual method of the base class.

Overloading Method

Overloading a method (or function) in C++ is the ability for functions of the same name to be defined as long as these methods have different signatures (different set of parameters).

In the following example, AddAndDisplay function is overloaded with different types of parameters.

void AddAndDisplay(int x, int y)

{

cout<<" C++ Tutorial - Integer result: "<<(x+y);

}

void AddAndDisplay(double x, double y)

{

cout<< " C++ Tutorial - Double result: "<<(x+y);

}