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


Write an operator overloading program to write S3+=S2.

Answers were Sorted based on User's Feedback



Write an operator overloading program to write S3+=S2...

Answer / som shekhar

class A
{
int id;

public:
A& operator +(const A& a1)
{
A a;
a.id = id + a1.id;
return a;
}
A & operator =(const A& a1)
{
if( this == &a1)
return;
else
{
A a;
a.id = a1.id;
return a;

}
}
};


S3 += S2 internaly will be called as
S3->operator=(s3->operator+(s2));

In this case first + operator will be called and then
assignment operator will be called.

Is This Answer Correct ?    0 Yes 1 No

Write an operator overloading program to write S3+=S2...

Answer / kkk

#include <iostream.h>
class ulhas
{


}

Is This Answer Correct ?    2 Yes 12 No

Post New Answer

More OOPS Interview Questions

i got a backdoor offer in process global,Bangalore..Can i work with it?

0 Answers  


What is Agile methodology?

20 Answers   ABC, Accenture, College School Exams Tests, Inmar, Microsoft, Sapient,


What is property in oops?

0 Answers  


What is the difference between abstraction and polymorphism?

0 Answers  


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

9 Answers   Aspire, IBS, TCS,


what is function overloading..?

4 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 difference between String s=new String("vali"); String s="vali"

1 Answers  


tel me oops defination in single line

2 Answers  


How to execute business logic for only once ..?even though user clicks submit button multiple times by mistake..? (i disabled JavaScript)

1 Answers  


how to find the correct email address format by using the programe?

1 Answers   Accenture,


How can you overcome the diamond problem in inheritance?

0 Answers   NIIT,


Categories