fork download
  1. #include <stdio.h>
  2.  
  3. void foo(int *p); // <<<<<<<<<< Declare your function first!
  4.  
  5. int main() {
  6.  
  7. int i = 97, *p = &i;
  8.  
  9. foo(&i); printf("%d ", *p);
  10. }
  11.  
  12. void foo(int *p) {
  13. int j = 2;
  14.  
  15. p = &j;
  16. printf("%d ", *p);
  17. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
2 97