fork download
  1. #include <iostream>
  2.  
  3. struct ExampleClass
  4. {
  5. int x;
  6. int y;
  7. ExampleClass(int z) : x(5)
  8. {
  9. y += z;
  10. }
  11. };
  12.  
  13. int main()
  14. {
  15. ExampleClass my_example_instance (1);
  16. std::cout << my_example_instance.x << ' '
  17. << my_example_instance.y << std::endl;
  18. }
Success #stdin #stdout 0s 2852KB
stdin
Standard input is empty
stdout
5 1