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