Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program do paliwa w klasach.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <stdio.h>
- using namespace std;
- class Port
- {
- private:
- char * brand;
- char style[20]; // na przykład lekko brazowe, rubinowe, z najlepszego rocznika
- int bottles;
- public:
- Port(const char * br = "Brak", const char * st = "Brak", int b =0);
- Port(const Port & p); // konstruktor kopiujacy
- virtual ~Port() {delete [] brand;}
- Port & operator=(const Port & p);
- Port & operator+=(int b); // dodaje b do bottles
- Port & operator-=(int b); // odejmuje b od bottles, jesli operacja ta jest mozliwa
- int BottleCount() const {return bottles;}
- virtual void Show() const;
- friend ostream &operator<<(ostream & os, const Port & p);
- };
- class VintagePort : public Port
- {
- private:
- char * nickname;
- int year;
- public:
- VintagePort();
- VintagePort(const char *br, const char * st, int b, const char *nm, int Year);
- VintagePort(const VintagePort &vp);
- ~VintagePort() {delete [] nickname;}
- VintagePort & operator=(const VintagePort & vp);
- void Show() const;
- friend ostream & operator<<(ostream & os, const VintagePort &vp);
- };
- int _tmain(int argc, _TCHAR* argv[])
- {
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement