Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- using namespace std;
- class super{
- protected:
- int mojProtint;
- private:
- int mojPrivint;
- public:
- void jakasMetoda(){
- cout<<"Tu jakas metoda z klasy super"<<endl;
- }
- };
- class sub:public super{
- public:
- void jakasInnaMetoda(){
- cout<<"tu jakasinnametoda z klasy sub"<<endl;
- }
- };
- int main(int argc, char** argv) {
- sub mySub;
- mySub.jakasMetoda();
- mySub.jakasInnaMetoda();
- super mySuper;
- mySuper.jakasMetoda();
- // mySuper.jakasInnaMetoda();
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement