Consider the following code where pb
is a member of class myclass
:
myclass& operator=(const myclass& rhs){
myclass *pOrig = pb;
pb = new myclass(*rhs.pb); //exception occurs here .
delete pOrig;
return *this;
}
Will the value of pb
remain the same or will it change ? Explain.
Aucun commentaire:
Enregistrer un commentaire