"Hi All, Have a question in malloc function usage. If we explictly pass 0 as argument to malloc int *ptr; ptr=(int *)malloc(0); What malloc will return, is it is implementation dependent ? or will it return NULL. When tried it had returned NULL, but some other platforms don't. Can anyone explain in detail. Regards, Shekar. "

Whenever we want to allocate memory on Heap using some allocater like
malloc, there is some additional memory being allocated by the Memory
manager of the OS for book keeping purposes.
For systems not returning null, is allocating a memory node from the OS
which can then be realloced to get more memory.
For systems which are returning null, not even the memory node is being
allocated.