Gillius's Programming Forums

Programming => Programming Questions => Topic started by: nicolas on September 01, 2006, 05:19:46 PM

Title: Is 'this' a pointer?
Post by: nicolas 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.
Title: Re: Is 'this' a pointer?
Post by: Gillius on September 02, 2006, 01:45:12 AM
`this` is a pointer that points to the object whose method you are executing.