fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class A {
  5. private:
  6. int x;
  7. public:
  8. A(int _x) : x(_x) {}
  9. void m(const A& other) {
  10. cout << other.x << endl;
  11. }
  12. };
  13.  
  14. int main() {
  15. A foo = A(1);
  16. A bar = A(2);
  17. foo.m(bar);
  18. return 0;
  19. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
2