fork download
  1. #include <stdio.h>
  2.  
  3. void swap(int & x, int & y)
  4. {
  5. int z = x;
  6. x = y;
  7. y = z;
  8. }
  9. int main()
  10. {
  11. int a = 0, b = 1;
  12. swap(a,b);
  13. printf("a is now %d\n", a);
  14. printf("b is now %d\n", b);
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:3:15: error: expected ‘;’, ‘,’ or ‘)’ before ‘&’ token
 void swap(int & x, int & y)
               ^
prog.c: In function ‘main’:
prog.c:12:5: warning: implicit declaration of function ‘swap’ [-Wimplicit-function-declaration]
     swap(a,b);
     ^~~~
stdout
Standard output is empty