On Thursday 21 April 2005 8:50 pm, Colin Carter wrote:
Anyway, you are both really saying that the memory where pointer value is stored contains a full house of zeros and one just tests for zero. This is correct. many C and C++ functions return pointers, and a return value of NULL indicates that some kind of error occurred.
An example of this is the fgets function: char *fgets(char *s, int size, FILE *stream); "fgets() returns s on success, and NULL on error or when end of file occurs while no characters have been read". Note that in general, Unix and Linux functions usually return 0 (integer 0) on success and usually -1 on failure. -- Jerry Feldman <gaf@blu.org> Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9