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

What is a scope resolution operator?

5 Answers   HP, IBS,


What are generic functions and generic classes?

5 Answers  


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

1 Answers  


what is object slicing

3 Answers   TCS,


what is the difference between <stdio.h>and "stdio.h"?

5 Answers  


What is a function in oop?

0 Answers  


What is the oops and benefits of oops programming?

0 Answers  


Why interface is used?

0 Answers  


sir plz send me a set of questions that been frequently held in written examination during campus selection.

0 Answers   TCS,


Name a typical usage of polymorphism

3 Answers  


What do we mean by a hidden argument in C++?

1 Answers  


what is the difference between function template and template of function?explain with example.

2 Answers  


Categories