fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Foo
  5. {
  6. int x;
  7. int y;
  8. };
  9.  
  10. struct Bar
  11. {
  12. Bar() :foo{} {}
  13.  
  14. Foo foo;
  15. int z;
  16. };
  17.  
  18.  
  19.  
  20. int main()
  21. {
  22. Bar b;
  23.  
  24. std::cout << b.foo.x << ", " << b.foo.y << ", " << b.z << std::endl;
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
0, 0, 0