Pointer & Function

I know that *this is a pointer & display() is a method. But how can I explain in words for the below code?

 
*this.display()
hi,

'this' is a pointer to the object that you are operating on

no need for the '*'

and display() is a method which operates on the current object

all though calling display() within the object would be the same as this.display()

hope this helps
Shredded

EDIT: Sorry i did mean this->display()
Last edited on
Ways to call the method:
1
2
3
display();
(*this).display(); //I'm not sure about the precedence
this->display();


this is a pointer so you do need to dereference it.
Last edited on
Topic archived. No new replies allowed.