Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- class Zwierzeta
- {
- public:
- virtual void dzwiek()
- {
- cout << "Wydanie dzwieku przez: ";
- }
- };
- class Ssaki :public Zwierzeta
- {
- public:
- virtual void dzwiek()
- {
- Zwierzeta::dzwiek();
- cout << "ssaka: ";
- }
- };
- int main()
- {
- Ssaki krowa;
- Zwierzeta *wsk;
- wsk =&krowa;
- wsk-> dzwiek();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement