fork download
  1. #include <stdio.h>
  2.  
  3. static int test(int xyz)
  4. {
  5. int *ptr;
  6.  
  7. if(xyz == 0)
  8. {
  9. int val = 4;
  10. ptr = &val;
  11. }
  12. printf("ptr @ = %p \n",ptr);
  13. printf("val @ = %p \n",&xyz);
  14. return (*ptr + 1);
  15. }
  16.  
  17. int main(void)
  18. {
  19. int i = test(0);
  20. printf("%d \n", i);
  21. return 0;
  22. }
Success #stdin #stdout 0s 2248KB
stdin
Standard input is empty
stdout
ptr @ = 0xbfbfbcfc 
val @ = 0xbfbfbcf8 
-1217749003