fork download
  1. #include <stdio.h>
  2.  
  3. void fun(int *ptr) {
  4. *ptr = 2;
  5. }
  6.  
  7. int main() {
  8. int a = 0;
  9. printf("%d\n", a);
  10.  
  11. fun(&a);
  12.  
  13. printf("%d\n", a);
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 1720KB
stdin
Standard input is empty
stdout
0
2