fork download
  1. #include <stdio.h>
  2.  
  3. typedef struct { char * word; int count; } wordType;
  4.  
  5. int main(void) {
  6. wordType tmp;
  7. wordType a = {.word="hello", .count=5};
  8. wordType b = {.word="world", .count=11};
  9. tmp = a;
  10. a = b;
  11. b = tmp;
  12. printf("A: %s %d\n", a.word, a.count);
  13. printf("B: %s %d\n", b.word, b.count);
  14. return 0;
  15. }
Success #stdin #stdout 0s 1832KB
stdin
Standard input is empty
stdout
A: world 11
B: hello 5