Guest User

Untitled

a guest
Jan 21st, 2020
69
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class k1 : public komunikator{
  2. protected:
  3. string *text;
  4.  
  5. public:
  6. k1(): text(new string("brak")) {}
  7. k1(const string& a): text(new string(a)) {}
  8. k1(const k1& a): text(new string(*a.text)) {}
  9.  
  10. k1& operator = (const k1& a) {
  11. if(this != &a) {
  12. delete text;
  13. text = new string(*a.text);
  14. }
  15. return *this;
  16. }
  17.  
  18.  
  19. ~k1() { delete text; }
  20.  
  21. ostream& wyswietl(ostream& out) const { return out << *text; }
  22. };
RAW Paste Data