3 ms·
> Why should it be allowed to return a valid pointers anyways? malloc(0) is allowed to return non-NULL because the standard decrees it. One way of thinking is
by bobmcnamara 1y ago
> Why should it be allowed to return a valid pointers anyways?
malloc(0) is allowed to return non-NULL because the standard decrees it.
One way of thinking is that all mallocated pointers must always be freed exactly once. Then you're portable.