fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class foo
  5. {
  6. public:
  7. int x, y;
  8. };
  9.  
  10. class bar
  11. {
  12. public:
  13. bar(int _x, int _y): x(_x), y(_y) {}
  14. int x;
  15. int y;
  16. };
  17.  
  18. int main() {
  19. // your code goes here
  20. foo f{1, 2};
  21. bar b{1, 2};
  22.  
  23. cout << f.x << " " << f.y << endl;
  24. cout << b.x << " " << b.y << endl;
  25. return 0;
  26. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
1 2
1 2