Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- class Bazowa{
- public:
- virtual void wypisza_a()
- {
- cout<<"A\n";
- }
- virtual void wypisza_b() = 0;
- void wypisza_c()
- {
- cout<<"C\n";
- }
- Bazowa(int n_a, int n_b, int n_c){};
- Bazowa(){};
- private:
- int a, b, c;
- };
- class Dziedziczona1: public Bazowa{
- public:
- void wypisz_wszystko()
- {
- cout<<"Dziedziczaca\n";
- };
- void wypisza_a()
- {
- cout<<"D\n";
- }
- void wypisza_b()
- {
- cout<<"E\n";
- }
- Dziedziczona1(int p1, int p2, int p3): Bazowa(p1, p2, p3)
- {
- };
- };
- int main()
- {
- Dziedziczona1 obiekt1 = Dziedziczona1(1, 2, 3);
- obiekt1.wypisza_a();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement