| | | | | |

Self-Reference

  • Keyword this contains the address of the object
  • A pointer to "self"
  • Private class member, always defined (never explicitly declared)
  • Used to access the location of the object and the object itself
  • // context/scope: implementation of a member function
    this  // pointer to the current object
    *this // the actual object
    

| | Top of Page | 6. C++ Classes Part 2: Advanced Features - 5 of 22