Interview Question
in constructor i=ii and j=ii
so A x(1,2); //x.i=1 x.j=1 constructor call
A y(3,4); // y.i=3 y.j=3
A z=(x=y);
both x an y are already created so "operator=" is called which does nothing but prints i and j of x;(x is caller of "operator=" here)
z is defined first time so copy constructor is called and i and j of x is printed
(x is argument of copy consturctor)
[1,2](1,2)
- Anonymous January 17, 2009