fork download
  1.  
  2. #include <cstdio>
  3.  
  4. class manko1
  5. {
  6. public:
  7. double x;
  8. };
  9.  
  10. class manko2 : public manko1
  11. {
  12. public:
  13. manko2(double x) : manko1(manko1{ x })
  14. {
  15. }
  16. };
  17.  
  18. auto main() -> int
  19. {
  20. manko2 i(3.14);
  21. std::printf("%lf\n", i.x);
  22. }
  23.  
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
3.140000