realloc0.c 254 B

12345678910111213
  1. #include <stdlib.h>
  2. int main(int argc, char **argv)
  3. {
  4. void *ptr = NULL;
  5. ptr = realloc(ptr, 0);
  6. printf("realloc(NULL, 0) -- pointer = %p\n", ptr);
  7. ptr = malloc(0);
  8. printf("malloc(0) -- pointer = %p\n", ptr);
  9. return 0;
  10. }