In this code snippet ,realloc is equivalent to malloc but I am unable to get the logic .
int *ptr=(int*) realloc(NULL,10*sizeof(int));
why does it creates a new block , since NULL is a macro defined in stdio.h as 0 so it implies that it points to the base address 0 which in most machines is system area , so how can realloc start allocating a memory from base address 0 for 10 integers , why is this not a segmentation fault ?