பின்வரும் நிரலின் வெளியீடு யாது?
#include< iostream >
using namespace std;
class T
{
public:
intx;
void foo( )
{
x = 6; // same as this- > x = 6;
this- > x = 5; // explicit use of this - >
cout << endl << x << " " << this -> x;
}
void foo(int x) // parameter x shadows the member with the same name
{
this-> x = x; // unqualified x refers to the parameter.'this->' required for disambiguation
cout << endl << x << " " << this -> x;
}};
int main( )
{
T t1,t2;
t1.foo( );
t2.foo( );
}