Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Zwierze
- {
- public:
- virtual void pisz()
- {
- cout << "zwierze" << endl;
- }
- };
- class Wilk:public Zwierze
- {
- public:
- void pisz()
- {
- cout << "wilk" << endl;
- }
- };
- class Owca:public Zwierze
- {
- };
- int main()
- {
- Zwierze* zwierzeta = new Wilk();
- zwierzeta->pisz();
- zwierzeta = new Owca();
- zwierzeta->pisz();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement