0

What did "this->" do again?

6th Aug 2016, 1:26 PM
jigoku_tenshi
3 Answers
+ 2
this = pointer of the object you are in for exemple you get a class call Base you maybe want to create a new objet (call Otherclass) taking as parameter a Base class so you use "*this" to have your Base class. the Otherclass constructor will look like: Otherclass(Base baseclassobject) And then in Otherclass you can access to your Base member. this-> Will access membre of your Base class (Var for example) Correct me if wrong
6th Aug 2016, 9:37 PM
Psyrkoz
Psyrkoz - avatar
+ 1
this-> is used to point a variable ( it is know as this pointer) . Correct me if I'm wrong :)
6th Aug 2016, 5:45 PM
Mr.Robot
Mr.Robot - avatar
0
I think for constant things... Like dont use : for const number and functions??? Not sure sorry...
6th Aug 2016, 5:31 PM
Thedudeplaysmc3
Thedudeplaysmc3 - avatar