// This program illustrates the this pointer. #include #include "ThisExample.h" using namespace std; int main() { Example ob1(10), ob2(20); // Print the addresses of the two objects. cout << "In main():" << endl; cout << "The object at address " << &ob1 << " has " << "value " << ob1.getValue() << endl; cout << "The object at address " << &ob2 << " has " << "value " << ob2.getValue() << endl; cout << endl; // Print the addresses and values from within // the member function. cout << "Calling printAddressAndValue():" << endl; ob1.printAddressAndValue(); ob2.printAddressAndValue(); return 0; }