fork(2) download
  1. #include <iostream>
  2. class A {
  3.  
  4. int x, y;
  5.  
  6. public:
  7. A(int x = 0, int y = 0) : x(x), y(y) {
  8. std::cout << "Constructeur de A \n";
  9. std::cout << "x = " << x << ", y= " << y << std::endl;
  10. }
  11.  
  12. };
  13. class B : A {
  14.  
  15. int d;
  16.  
  17. public: B(int x, int y, int d=2) : A(x,y), d(d) {
  18. std::cout << "Constructeur de B \n";
  19. std::cout << "d = " << d<< std::endl;
  20. }
  21.  
  22.  
  23. };
  24.  
  25. int main() { return 0; }
Success #stdin #stdout 0s 3452KB
stdin
Standard input is empty
stdout
Standard output is empty