fork(1) download
  1. #include <iostream>
  2.  
  3. class A
  4. {
  5. public:
  6. int x;
  7. A(int x)
  8. {
  9. this ->x = x;
  10. }
  11. };
  12.  
  13. struct B
  14. {
  15. int x;
  16. B(int x)
  17. {
  18. this ->x = x;
  19. }
  20. };
  21.  
  22. int main()
  23. {
  24. A a (1);
  25. B b (2);
  26. std::cout << a.x << std::endl << b.x << std::endl;
  27. }
  28.  
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
1
2