Advertisement
frentzy

test poo mostenire + virtual

May 22nd, 2018
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. #include <conio.h>
  2. #include <stdio.h>
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. class testvirtual {
  8. public:
  9.     testvirtual() {
  10.  
  11.     }
  12.     virtual void functie();
  13.     void virtual functie2();
  14.     void functie3();
  15. };
  16. void testvirtual::functie2() {
  17.     cout << "y";
  18. }
  19. void testvirtual::functie() {
  20.     cout << "n";
  21. }
  22. void testvirtual::functie3() {
  23.     cout << "\nasta este din clasa test virtual\n";
  24. }
  25. class testmostenire: public testvirtual {
  26. public:
  27.     testmostenire() {
  28.  
  29.     }
  30.     void functie();
  31.     void functie3();
  32. };
  33. void testmostenire::functie() {
  34.     cout << "\nfunctie() testmostenire\n";
  35. }
  36. void testmostenire::functie3() {
  37.     cout << "\nfunctie3() testmostenire\n";
  38. }
  39.  
  40.  
  41. void main() {
  42.     testvirtual asd;
  43.     testmostenire ddd;
  44.     //asd.functie();
  45.     //ddd.functie();
  46.     ddd.functie3();
  47.     _getch();
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement