Preizkus::Preizkus(int a) { x = a; } // konstruktor
void Preizkus::izpisi() const
{
cout << " x = " << x << endl << " this->x = " << this->x << endl << "(*this).x = " << (*this).x << endl;
}
main()
{
Preizkus a(12);
a.izpisi();
return 0;
}
Program izpiše:
x = 12
this->x = 12
(*this).x = 12