Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Rekord
- {
- protected:
- string nazwa;
- public:
- Rekord(string tytul) : nazwa(tytul) {}
- };
- class film : public Rekord // public Rekord informuje kompilator, że klasa ta dziedziczy od klasy Rekord (jest jej klasą pochodną)
- {
- string rezyser, gatunek;
- int rok_produkcji;
- public:
- film(string director, string tytul, string rodzaj, int rok) : Rekord(tytul), rezyser(director), gatunek(rodzaj), rok_produkcji(rok) {}
- };
- class czasopismo : public Rekord
- {
- int numer;
- };
- class ksiazka : public Rekord
- {
- string wydawnictwo, autor, miasto_wydania;
- int ilosc_stron, rok_wydania;
- };
- int main()
- {
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement