function overloadingfunction overloading is a


Function Overloading

Function overloading is a form of polymorphism. Function overloading facilitates explaining one function having many forms. In other words it facilitates explaining several functions with the same name, thus overloading the function names. Like in operator overloading, even here, the compiler uses context to verify which definition of an overloaded function is to be invoked.

Function overloading is used to define a set of functions that essentially, do the similar thing, but use different argument lists. The argument list of the function is also call as the function's signature. You can overload the function only if their signatures are dissimilar. 

The differences can be

 1. In number of arguments,

 2. Data types of the arguments,

 3. Order of arguments, if the number and  data types of the arguments are similar.

e.g.

                                int add( int, int );

                                int add( int, int, int );

                                float add( float, float );

                                float add( int, float, int );

                                float add(int,int,float);  

 

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: function overloadingfunction overloading is a
Reference No:- TGS0309410

Expected delivery within 24 Hours