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

nicolas

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

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.

Gillius

  • Administrator
  • User
  • *****
  • Posts: 147
    • http://www.gillius.org/
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
Gillius's Programming http://www.gillius.org/