Difference between this. and this->

One will compile, one won’t. this is a pointer, and you can’t apply . to a pointer. Use -> to access members of the object it points to.

Leave a Comment