0

What is the error in this please help:: topic --> this pointer

https://code.sololearn.com/ci7lP0nDbZCK/?ref=app

23rd Mar 2018, 9:35 AM
Kratos
Kratos - avatar
12 Antworten
+ 6
(*this) is the address of the current object "return this; "would not return a variable.
23rd Mar 2018, 9:50 AM
Manual
Manual - avatar
+ 3
try string over the char pointer so you do not need strcpy() make a name variable for your class.
23rd Mar 2018, 9:43 AM
Manual
Manual - avatar
+ 2
ok I noticed you tried using return to set values to an object. there are many errors - sorry it is too much for me to fix
23rd Mar 2018, 10:03 AM
Manual
Manual - avatar
+ 2
Lets start over.
23rd Mar 2018, 10:06 AM
Manual
Manual - avatar
+ 2
could you post the code please. I was thinking that method needed to removed and rewritten. - as long as it works
23rd Mar 2018, 10:11 AM
Manual
Manual - avatar
+ 1
This is a problem person & greater( person &x) { if(x.age>age) return x; else return this; } few others too
23rd Mar 2018, 9:38 AM
Manual
Manual - avatar
0
what in this? this is exactly same as i wrote
23rd Mar 2018, 9:40 AM
Kratos
Kratos - avatar
0
how
23rd Mar 2018, 9:45 AM
Kratos
Kratos - avatar
0
ohh yess thankx
23rd Mar 2018, 9:52 AM
Kratos
Kratos - avatar
0
person & greater( ) wy we write tis 👆👆
23rd Mar 2018, 9:58 AM
Kratos
Kratos - avatar
0
*when
23rd Mar 2018, 9:59 AM
Kratos
Kratos - avatar
0
no there is just one error of *this now code is executing properly😊
23rd Mar 2018, 10:08 AM
Kratos
Kratos - avatar