I always think simply if(p != NULL){..} will do the job. But after reading this Stack Overflow question, it seems not.
if(p != NULL){..}
So what\'s the canonical way to c
The representation of pointers is irrelevant to comparing them, since all comparisons in C take place as values not representations. The only way to compare the representation would be something hideous like:
static const char ptr_rep[sizeof ptr] = { 0 }; if (!memcmp(&ptr, ptr_rep, sizeof ptr)) ...