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