5 Jan
2003
5 Jan
'03
8:54 p.m.
Zero is fundamentally built into the language so deep, that playing with tricks like NULL and '\0' seem like a waste of time.
FWIW I agree. In C the character '0' appearing in a source file is the correct denotation for a 'null' pointer even when the bit-pattern for a null pointer isn't all zeros. ie the value assigned by 'ptr = 0;' could be different from that generated by 'int i = 0; ptr = (void *)i;' Similarly 'if (ptr) ...' and 'if (!ptr) ...' are valid checks for a null pointer, save 8 bytes on the line and stop the (usually) erronous 'if (ptr = NULL) ...'. David -- David Laight: david(a)l8s.co.uk