Author Topic: Is 'this' a pointer?  (Read 8307 times)


  • User
  • *
  • Posts: 3
Is 'this' a pointer?
« on: September 01, 2006, 05:19:46 PM »

I have classes containing others (they represent windows) and I need the inside elements to what is the container window (to call its methods). So I will use something like element->SetParent(Elem* parent). Can I call it like this? elem->SetParent(this); Is this a pointer to the current class, or the class itself (so I would need &this)?

Thanks in advance.


  • Administrator
  • User
  • *****
  • Posts: 147
Re: Is 'this' a pointer?
« Reply #1 on: September 02, 2006, 01:45:12 AM »
`this` is a pointer that points to the object whose method you are executing.
Gillius's Programming