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

What is the default width for ouputting a long integer using the insertion operator?

0 Answers  


why can't we declare data member of class auto register or extern

1 Answers  


Write a code/algo to find the frequency of each element in an array?

0 Answers   Axtria,


Explain how would you handle a situation where you cannot call the destructor of a local explicitly?

0 Answers  


Describe the advantages of operator overloading?

0 Answers  






Explain one method to process an entire string as one unit?

0 Answers  


sir there is some problem with nokia5130c-2,when we are trying to upload movies from net then there is a error occurred"FORMAT NOT SUPPORTED" bt its all ready in 3gp format.please tell me what i do now?

2 Answers   Nokia,


How do you invoke a base member function from a derived class in which you have not overridden that function?

0 Answers  


How does a C++ structure differ from a C++ class?

0 Answers   NIIT,


Copy Linked List using recursive function?

2 Answers   Persistent,


an operation between an integer and real always yeilds a) integer result b) real result c) float result

0 Answers  


What is an ABC: an "Abstract Base Class"?

1 Answers  






Categories