fork download
  1. #include <stdio.h>
  2.  
  3. int *gp;
  4.  
  5. void func(int **pp)
  6. {
  7. int *i = malloc(sizeof(int));
  8. *i = 5;
  9. *pp = i;
  10. }
  11.  
  12. int main(void)
  13. {
  14. int **p;
  15. p = &gp;
  16. func(&*p);
  17.  
  18. printf("gp:%d\n", *gp);
  19.  
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 4400KB
stdin
Standard input is empty
stdout
gp:5