Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Difference between Operator overloading and Functional
overloading?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where and why do I have to put the "template" and "typename" keywords?

976


What is setbase c++?

1049


Is c++ still being used?

964


What relational operators if statements in c++?

1113


Is java easier than c++?

950


Is c++ a high level language?

940


What is the cout in c++?

1000


What character terminates all character array strings a) b) . c) END

1202


What is the use of setfill in c++?

1028


What is format for defining a structure?

1029


What is low level language in simple words?

973


What are the advantages of early binding?

1010


How does a copy constructor differs from an overloaded assignment operator?

965


What is a string example?

1008


What is meaning of in c++?

1144