About
Pricing
Community
Teams
Start Free Trial
Log in
LuckyLucks
asked on
2/24/2016
returning a dereferenced pts in C++
A&
A::operator= (const A& a) {
if (this == &a)
return (*this); <----
}
Does the above make sense? shouldn't we be returning this and not *this?
C++
9
4
Last Comment
phoffric
8/22/2022 - Mon
SOLUTION
Zoppo
2/24/2016
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
sarabande
2/24/2016
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
LuckyLucks
3/3/2016
ASKER
actually let's revisit this.
A& would return the address of the object. *this the value. they are not the same.
SOLUTION
evilrix
3/4/2016
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
LuckyLucks
3/31/2016
ASKER
Best split.
LuckyLucks
4/25/2016
ASKER
share pts and close.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
ASKER CERTIFIED SOLUTION
sarabande
4/25/2016
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
LuckyLucks
5/17/2016
ASKER
completed.
phoffric
5/17/2016
Good to hear that reopening the question helped you better understand the issue.
A& would return the address of the object. *this the value. they are not the same.