Difference between Operator overloading and Functional
overloading?

Answers were Sorted based on User's Feedback



Difference between Operator overloading and Functional overloading?..

Answer / swetcha

Function overloading is like you have different functions
with the same name but different signatures working
differently. So, the compiler can differentiate and find
out which function to call depending on the context. In
case of operator overloading, you try to create your own
functions which are called when the corresponding operator
is invoked for the operands.

One important thing to understand is that you can create as
many functions as you want with the same name and sifferent
signatures so that they can work diffrently but for a
particular class, you cannot overload the operator function
based on number of arguments. There is a fundamental reason
behind this.

According to the rules, you can not create your own
operators but you have to use already available operators.
Another thing is since the operator are already defined for
use with buily-in types you can not change their
charecteristics. For example the binary operator '+' always
takes two parameters, so for this you cannot create a
function that takes three parameters. But you can always
overload them based on the type of the parameters.

Is This Answer Correct ?    115 Yes 14 No

Difference between Operator overloading and Functional overloading?..

Answer / d289

did you guys copy each others answer? :P

Is This Answer Correct ?    60 Yes 18 No

Difference between Operator overloading and Functional overloading?..

Answer / archana

FUNCTION OVERLOADING IS THE CONCEPT TO USE SAME FUNCTION
NAME <OF OUR OWN CHOICES> WITH DIFFERNT ARGUMENTS.......


AND......

OPERATOR OVERLOADING IS TO USE THE EXITING OPERATORS TO
OVERLOAD EXCEPT THE FIVE OPERATORS...

Is This Answer Correct ?    42 Yes 16 No

Difference between Operator overloading and Functional overloading?..

Answer / rajkumar tyagi

Function overloading is like you have different functions
with the same name but different signatures working
differently. So, the compiler can differentiate and find
out which function to call depending on the context. In
case of operator overloading, you try to create your own
functions which are called when the corresponding operator
is invoked for the operands.

One important thing to understand is that you can create as
many functions as you want with the same name and sifferent
signatures so that they can work diffrently but for a
particular class, you cannot overload the operator function
based on number of arguments. There is a fundamental reason
behind this.

According to the rules, you can not create your own
operators but you have to use already available operators.
Another thing is since the operator are already defined for
use with buily-in types you can not change their
charecteristics. For example the binary operator '+' always
takes two parameters, so for this you cannot create a
function that takes three parameters. But you can always
overload them based on the type of the parameters.

Is This Answer Correct ?    24 Yes 16 No

Difference between Operator overloading and Functional overloading?..

Answer / rock

we use predefined operators like +,-,* etc.. to perform
operations only between normal variables even in order to
perform between user defined variables we use operator
overloading.

when two or more functions having same name but different
signatures we use function overloading.
Here compiler uses NAME MANGLING to differentiate between the
functions.

Is This Answer Correct ?    17 Yes 11 No

Difference between Operator overloading and Functional overloading?..

Answer / ok

Function overloading is like you have different functions
with the same name but different signatures working
differently. So, the compiler can differentiate and find
out which function to call depending on the context. In
case of operator overloading, you try to create your own
functions which are called when the corresponding operator
is invoked for the operands.

One important thing to understand is that you can create as
many functions as you want with the same name and sifferent
signatures so that they can work diffrently but for a
particular class, you cannot overload the operator function
based on number of arguments. There is a fundamental reason
behind this.

According to the rules, you can not create your own
operators but you have to use already available operators.
Another thing is since the operator are already defined for
use with buily-in types you can not change their
charecteristics. For example the binary operator '+' always
takes two parameters, so for this you cannot create a
function that takes three parameters. But you can always
overload them based on the type of the parameters.

Is This Answer Correct ?    16 Yes 11 No

Difference between Operator overloading and Functional overloading?..

Answer / nsit@salem

C++ provides more than 35 operators, covering basic
arithmetic, bit manipulation, indirection, comparisons,
logical operations and others. Almost all operators can be
overloaded for user-defined types, with a few notable
exceptions such as member access (. and .*) as well as the
conditional operator. The rich set of overloadable operators
is central to using C++ as a domain-specific language. The
overloadable operators are also an essential part of many
advanced C++ programming techniques, such as smart pointers.
Overloading an operator does not change the precedence of
calculations involving the operator, nor does it change the
number of operands that the operator uses (any operand may
however be ignored by the operator, though it will be
evaluated prior to execution). Overloaded "&&" and "||"
operators lose their short-circuit evaluation property.
Operators that cannot be overloaded

Is This Answer Correct ?    7 Yes 2 No

Difference between Operator overloading and Functional overloading?..

Answer / chandu

Function overloading is like you have different functions
with the same name but different signatures working
differently. So, the compiler can differentiate and find
out which function to call depending on the context. In
case of operator overloading, you try to create your own
functions which are called when the corresponding operator
is invoked for the operands.

One important thing to understand is that you can create as
many functions as you want with the same name and sifferent
signatures so that they can work diffrently but for a
particular class, you cannot overload the operator function
based on number of arguments. There is a fundamental reason
behind this.

According to the rules, you can not create your own
operators but you have to use already available operators.
Another thing is since the operator are already defined for
use with buily-in types you can not change their
charecteristics. For example the binary operator '+' always
takes two parameters, so for this you cannot create a
function that takes three parameters. But you can always
overload them based on the type of the parameters.

Is This Answer Correct ?    10 Yes 6 No

Difference between Operator overloading and Functional overloading?..

Answer / jknjkjk

Function overloading is like you have different functions
with the same name but different signatures working
differently. So, the compiler can differentiate and find
out which function to call depending on the context. In
case of operator overloading, you try to create your own
functions which are called when the corresponding operator
is invoked for the operands.

One important thing to understand is that you can create as
many functions as you want with the same name and sifferent
signatures so that they can work diffrently but for a
particular class, you cannot overload the operator function
based on number of arguments. There is a fundamental reason
behind this.

According to the rules, you can not create your own
operators but you have to use already available operators.
Another thing is since the operator are already defined for
use with buily-in types you can not change their
charecteristics. For example the binary operator '+' always
takes two parameters, so for this you cannot create a
function that takes three parameters. But you can always
overload them based on the type of the parameters.

Is This Answer Correct ?    13 Yes 16 No

Difference between Operator overloading and Functional overloading?..

Answer / r

Function overloading is when a class inherits from another class and codes a functionality for a function defined in the base class.

Operator overloading is when the default behaviour of operators (+, =, ==, etc.) is modified by user defined actions.

Thanks.

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More C++ General Interview Questions

How can you quickly find the number of elements stored in a dynamic array?

0 Answers  


What is the use of vtable?

0 Answers  


What happens when you make call 'delete this;'?

0 Answers  


Is there something that we can do in C and not in C++?

14 Answers   Patni,


What are 2 ways of exporting a function from a dll?

0 Answers  






which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?

0 Answers  


What is data abstraction? How is it different from data encapsulation?

0 Answers  


What is public, protected, private in c++?

0 Answers  


Can inline functions have a recursion? Give the reason?

3 Answers  


What is abstract keyword in c++?

0 Answers  


What is the use of this pointer in c++?

0 Answers  


why we cant create array of refrences

4 Answers  


Categories