Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. class Port
  2. {
  3.     char * brand;
  4.     char style[20]; // na przykład lekko brazowe, rubinowe, z najlepszego rocznika
  5.     int bottles;
  6. public:
  7.     Port(const char * br = "Brak", const char * st = "Brak", int b =0);
  8.     Port(const Port & p); // konstruktor kopiujacy
  9.     virtual ~Port {delete [] brand;}
  10.     Port & operator=(const Port & p);
  11.     Port & operator+=(int b); // dodaje b do bottles
  12.     Port & operator-=(int b); // odejmuje b od bottles, jesli operacja ta jest mozliwa
  13.     int BottleCount() cont {return bottles;}
  14.     virtual void Show() const;
  15.     friend ostream &operator<<(ostream & os, const Port & p);
  16. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement