Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  4. using namespace std;
  5. class super{
  6. protected:
  7. int mojProtint;
  8. private:
  9. int mojPrivint;
  10. public:
  11. void jakasMetoda(){
  12. cout<<"Tu jakas metoda z klasy super"<<endl;
  13. }
  14.  
  15.  
  16. };
  17. class sub:public super{
  18. public:
  19. void jakasInnaMetoda(){
  20. cout<<"tu jakasinnametoda z klasy sub"<<endl;
  21. }
  22. };
  23. int main(int argc, char** argv) {
  24.  
  25. sub mySub;
  26. mySub.jakasMetoda();
  27. mySub.jakasInnaMetoda();
  28. super mySuper;
  29. mySuper.jakasMetoda();
  30. // mySuper.jakasInnaMetoda();
  31.  
  32. return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement