fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #define SIZE 16
  5.  
  6. void main(void)
  7. {
  8. int *ptr = (int*)malloc(sizeof(int)*SIZE);
  9. if ( ptr == NULL)
  10. exit(EXIT_FAILURE);
  11.  
  12. printf("1:ptr=%p\n",ptr);
  13. realloc(ptr,0);
  14. printf("2:ptr=%p\n",ptr);
  15. }
Runtime error #stdin #stdout 0s 1964KB
stdin
Standard input is empty
stdout
1:ptr=0x984e008
2:ptr=0x984e008