fork download
  1. #include <stdio.h>
  2.  
  3. void foo(int **const p);
  4.  
  5. int main(void){
  6. int i = 10;
  7. int *p = &i;
  8. foo(&p);
  9. printf("%d ", *p);
  10. printf("%d ", *p);
  11. return 0;
  12. }
  13.  
  14. void foo(int **const p){
  15. int j = 11;
  16. *p = &j;
  17. p = &j;
  18. printf("%d ", **p);
  19. }
  20.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function 'foo':
prog.c:17:7: error: assignment of read-only parameter 'p'
     p = &j;
       ^
stdout
Standard output is empty