![]() |
Matthias.Apitz@SOFTCON.de ,in message <9710091807.AA07194@kant.SOFTCON.de>, wro te: > > BTW: Do you have some information why some systems map a NULL pointer > to a 0x00 and others don't? Perhaps I should explain. The null pointer is always comparable to zero in an ANSI or C++ system. I'm fairly certain they defined it that way. The bit battern in memory or register may be non-zero, but when you convert it or compare it to an int, it must look like (int)0. But, I was talking about something else. I have heard legends that if you dereference a NULL pointer on some systems (I believe HPUX had this "feature") it gives you a NUL character: '\0' . Consider the code char *a = 0; char c = *a; /* SEGV on most systems */ printf("%d", (int)c); /* prints out 0 on the wacky systems */ Yes, this can lead to sloppy coding by people weaned on such systems. I object to the very concept that you could dereference a NULL pointer and keep running. -- Bob Forsman thoth@gainesville.fl.us http://www.gainesville.fl.us/~thoth/