Function overloading is compile time polymorphism.

Function overloading is the practice of declaring the same function with different signatures.

The same function name will be used with different number of parameters and parameters of different  type.

Overloading of functions with different return types is not allowed.

Compiler identifies which function should be called out of many using the type and number of arguments.

A function is overloaded when same name is given to different functions.

However, the two functions with the same name must differ in at least one of the following,

a) The number of parameters

b) The data type of parameters

c) The order of appearance


#define PI 3.14
class A
        int a,b;
        float c;
        void area(int x)
            cout<<" the area of circle="<<PI*a*a<<endl;
        void area(int x,int y)
            cout<<" the area of Rectangle="<<PI*a*a<<endl;
        void area(float x ,int y,int z)
            cout<<" the area of Triangle="<<PI*a*a<<endl;
void main()
    A a1;
    int l,m,n;
    cout<<"Enter l=";
    cout<<"Enter m=";
    cout<<"Enter n=";