fork(8) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Base
  5. {
  6. public:
  7. Base (int v, char z) {x=v;y=z;};
  8. int x;
  9. char y;
  10. };
  11.  
  12. class Bar
  13. {
  14. public:
  15. Bar(int m, char n):base(m,n),q(m),s(n){};
  16. Base base;
  17. int q;
  18. char s;
  19.  
  20. };
  21.  
  22. int main()
  23. {
  24. Bar barObj(5,'h');
  25.  
  26. cout << barObj.base.x << barObj.base.y << endl;
  27.  
  28.  
  29. return 0;
  30. }
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
5h