#include <iostream>
using namespace std;

class Test
{
  public:
    Test( int value = 0 )
     : x( value ), y(5) 
    {   } 
    void print() const{
      // implicitly use the this pointer to access the member x
      cout << "        x = " << x;                             
     // explicitly use the this pointer and the arrow operator
     // to access the member x                                
     cout << "\n this->x = " << this->x;                      
     // explicitly use the dereferenced this pointer and
     // the dot operator to access the member x         
     cout << "\n(*this).y = " << ( *this ).y << endl;   
    } 
  private:
    int x;
    int y;
}; // end class Test
 
  main()
  {
     Test testObject( 12 ); // instantiate and initialize testObject

     testObject.print();
     system("pause");
  } // end main
