What's this?

This is a discussion on What's this? within the C++ Programming forums, part of the General Programming Boards category; Someone please tell me the difference between this.something and this->something...

  1. #1
    Aspiring "Software Guy"
    Join Date
    Aug 2005
    Posts
    46

    What's this?

    Someone please tell me the difference between this.something and this->something

  2. #2
    Registered User
    Join Date
    May 2006
    Posts
    903
    this.something is an error and this->something is not. this is a pointer so if you want to use the dot operator, you have to dereference the pointer: (*this).something.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21