fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct point { int x; int y; } a, b;
  5.  
  6. int main() {
  7. a.x = 1; a.y = -1;
  8. b.x = 2; b.y = 3;
  9. point tmp = a; a = b; b = tmp;
  10. cout << a.x << " " << a.y << endl;
  11. cout << b.x << " " << b.y << endl;
  12. }
Success #stdin #stdout 0s 4356KB
stdin
Standard input is empty
stdout
2 3
1 -1