Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     




Function Overloading

Function Overloading In C++ Image



Here we have overloaded the function ‘area ( )’ to perform three operations- find area of square, find area of rectangle and find area of circle. Thus the function name is same but it is performing different operations. The selection of a particular function for a particular function call is being done on the basis of number, types and sequence of arguments. The first function call has one argument of integer type so it will call the first function as it is taking one integer type argument. The second function call has two arguments of integer type so it will call the second function as it is taking two integer arguments. The third function call has one argument of float type so it will call the third function as it is taking one float argument.

Share this article   |    Print    |    Article read by 4110 times
Author:
Rohit kakria
I am software developer
Related Articles: No related article
Related Interview Questions: No related interview question