realloc0.c 250 B

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