Wednesday, 14 August 2013

change 'this' pointer of an object to point different object

change 'this' pointer of an object to point different object

class C{
//methods and properties
}
void C::some_method(C* b){
delete this;
this = b;
}
This gives me follwing error when compiling:
error: lvalue required as left operand of assignment

No comments:

Post a Comment