fork download
  1. #include <stdio.h>
  2.  
  3. struct S
  4. {
  5. int i;
  6. };
  7.  
  8. void swap(struct S *a, struct S *b)
  9. {
  10. struct S temp;
  11. temp = *a /* Oops, missing a semicolon here... */
  12. *a = *b;
  13. *b = temp;
  14. }
  15.  
  16. int main(void)
  17. {
  18. struct S a = { 1 };
  19. struct S b = { 2 };
  20.  
  21. swap(&a, &b);
  22. }
  23.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function 'swap':
prog.c:12:5: error: invalid operands to binary * (have 'struct S' and 'struct S *')
     *a = *b;
     ^
stdout
Standard output is empty