If two or more members having same name but have different parameter,is known as C++ overloading.Methods,Constructor and some properties can overload.There are two type of overloading in C++.
Function overloading
When a program having two or more function with same name but different in parameters, is known as function overloading.
#include class C { public: static int add(int x , int y) { return x + y; } static int add(int x, int y, int z) { return x + y + z; } }; void main() { C c; cout << c.add(40, 20)<< endl; cout << c.add(10, 20, 30); }
output:
60
60
Operators overloading
Operator overloading is used for redefine the operator which available in C++.It is used to perform operation on user define data type.