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...


why to use operator overloading

Answers were Sorted based on User's Feedback



why to use operator overloading..

Answer / chandra

to achieve synchronization with the normal languages like c.
for example int a=10,b=30,c;
c = a+b ;
the above operation is possible in c as well as c++.bcos
the variables declared are primitive types.

If u want to do same thing for user defined datatypes, i
can say objects, we have to overload the operators.

For ex:
Assume that u created one class
Class A
and u have created objects
A obj1(10),obj2(30),obj3;

and u want the add 2 objects and result must be stored in
another object.

then u have to overload the operator + for class A.

obj3 = obj1 + obj2 ;

Is This Answer Correct ?    7 Yes 0 No

why to use operator overloading..

Answer / rekha

Operator overloading means giving additional meaning to
existing operators

Operators are defined to perform some operation on
fundamental types .Operator cannot work with user defined
types like classes and struct.so concept of operator
overloading means allows defining the meaning of operator so
that the can be used for performing operations on user defined
types.

Is This Answer Correct ?    3 Yes 0 No

why to use operator overloading..

Answer / r.ramakrishna

BY using the operator overloading we can the more than one
operator in single function.

Is This Answer Correct ?    4 Yes 4 No

Post New Answer

More OOPS Interview Questions

write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory

0 Answers  


How compiler selects(internally) required overridden function in inheritance?

2 Answers   CSC, Infinite Computer Solutions,


what is the difference between class and structure in C++?

9 Answers   Aspire, IBS, TCS,


what is costructor?

1 Answers  


Have you ever used threads?

3 Answers   Adobe, IBM,


How is class defined?

0 Answers  


WHAT IS THE ACTUAL DEFINATION OF OBJECT AND THE CLASS IN ONE SINGLE LINE WHICH THE INTERVIEWER WANT TO LISTEN.

11 Answers  


What is Method overloading?

5 Answers  


Why do we use class in oops?

0 Answers  


What is a null tree?

0 Answers  


what is the size of an empty class

12 Answers   Wipro,


Is following functions are said to be overloaded? int add(int a,int b) char *add(int a,int b)

4 Answers  


Categories