fork download
  1. #include <stdio.h>
  2.  
  3. void swapnum(int *i, int *j) {
  4. int temp = *i;
  5. *i = *j;
  6. *j = temp;
  7. }
  8.  
  9. int main(void) {
  10. int a = 10;
  11. int b = 20;
  12. int * c = &a;
  13. swapnum(&c, &b);
  14. printf("A is %d and B is %d\n", a, b);
  15. return 0;
  16. }
  17.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:13:17: error: cannot convert 'int**' to 'int*' for argument '1' to 'void swapnum(int*, int*)'
stdout
Standard output is empty