fork download
  1. #include <stdio.h>
  2.  
  3. void test2(int **a)
  4. {
  5. *a = (int *)malloc(sizeof(int));
  6. **a = 10;
  7. }
  8.  
  9. void test1(int **a)
  10. {
  11. test2(a);
  12. }
  13.  
  14. void test(int **a)
  15. {
  16. test1(a);
  17. }
  18.  
  19. int main(void) {
  20. // your code goes here
  21. int *a;
  22. test(&a);
  23. printf("value is %d \n", *a);
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 5444KB
stdin
Standard input is empty
stdout
value is 10