Advertisement
mario_mos

mario_heritage1

Aug 30th, 2023
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. #ifndef MERE_H
  2. #define MERE_H
  3.  
  4.  
  5. class mere
  6. {
  7. public:
  8.     mere();
  9. };
  10.  
  11. #endif // MERE_H
  12.  
  13. #include "mere.h"
  14. #include <iostream>
  15.  
  16. mere::mere()
  17. {
  18.   std::cout << "constructor mere" << std::endl;
  19. }
  20.  
  21. #ifndef FILLE1_H
  22. #define FILLE1_H
  23. #include "mere.h"
  24.  
  25. class fille1 : public mere
  26. {
  27. public:
  28.     fille1();
  29.     int m_fi;
  30.  
  31. };
  32.  
  33. #endif // FILLE1_H
  34.  
  35. #include "fille1.h"
  36. #include<iostream>
  37.  
  38. fille1::fille1()
  39. {
  40.   std::cout << "constructor fille1" << std::endl;
  41. }
  42.  
  43. #include <iostream>
  44. #include <mere.h>
  45. #include <fille1.h>
  46. using namespace std;
  47.  
  48. int main()
  49. {
  50.     fille1 tesf_f1;
  51.  
  52.     return 0;
  53. }
  54.  
  55. /*RESULTAT*/
  56. 09:15:56: Starting /home/mariomoser/9_cpp/ex7_heritage/build-heritage1-Desktop-Debug/heritage1...
  57. constructor mere
  58. constructor fille1
  59. 09:15:56: /home/mariomoser/9_cpp/ex7_heritage/build-heritage1-Desktop-Debug/heritage1 exited with code 0
  60.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement