Not to be nitpicking but NULL is not the same as nil or null, nil is a real type, while NULL is a #define. So, NULL == 0 but NULL != nil != null.

For checking if a pointer is set to something you can use NULL for initializing it:

void* ptr = NULL;

and then:

if (ptr) // true if ptr was set to something, otherwise false
...