What is function overloading and operator overloading?

Ask a question
          

Interview questions

What is function overloading and operator overloading?


<< Previous  Next>>
C++  - What is function overloading and operator overloading? - April 16, 2009 at 12:12 PM by Vidya Sagar

What is function overloading and operator overloading?  

Function overloading: A feature in C++ that enables several functions of the same name can be defined with different types of parameters or different number of parameters. This feature is called function overloading. The appropriate function will be identified by the compiler by examining the number or the types of parameters / arguments in the overloaded function. Function overloading reduces the investment of different function names and used to perform similar functionality by more than one function.

Operator overloading: A feature in C++ that enables the redefinition of operators. This feature operates on user defined objects. All overloaded operators provides syntactic sugar for function calls that are equivalent. Without adding to / changing the fundamental language changes, operator overloading provides a pleasant façade.

C++  - What is function overloading in C++? - Feb 23, 2009 at 16:45 PM

What is function overloading in C++?

You can have multiple functions with same name using function overloading facility of C++. You can use same name for multiple functions when all these functions are doing same thing.

C++  - What is operator overloading in C++? - Feb 23, 2009 at 16:45 PM

What is operator overloading in C++?

With this facility in C++, you can give additional meaning to operators.

Also read

Overriding vs. overloading

Overloading means having methods with same name but different signature
Overriding means rewriting the virtual method of the base class.............

What is operator overloading in C++?

C++ provides ability to overload most operators so that they perform special operations relative to classes. For example, a class String can overload the + operator to concatenate two strings....................

<<Previous  Next>>


Write your comment - Share Knowledge and Experience


 
Latest placement tests
Latest links
 
 
Home | Login | About us | Sitemap | Contact us