Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. Bank_Client& Bank_Client::operator=(const Bank_Client &addres){
  2. std::string *temp = new std::string(*addres.name);
  3. delete name;
  4. name = temp;
  5. return *this;
  6. }
  7.  
  8. Bank_Client bob("Bobinsky");
  9. bob = bob;
  10.  
  11. Bank_Client& Bank_Client::operator=(const Bank_Client &addres){
  12. if (this != &addres){
  13. delete name;
  14. name = new std::string(*addres.name);
  15. }
  16. return *this;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement