fork download
  1.  
  2. #include <stdio.h>
  3.  
  4. struct s {
  5. int x;
  6. int y;
  7. };
  8.  
  9. int main(void)
  10. {
  11. struct s a = {10, 20};
  12. struct s b = {10, 20};
  13. struct s c = {30, 40};
  14.  
  15. if (a.x == b.x) a.x = c.x;
  16. printf("a.x = %d\n", a.x);
  17.  
  18. a = b;
  19.  
  20. // if (a == b) a = c;//
  21. printf("a.y = %d\n", a.y);
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
a.x = 30
a.y = 20