On January 5, 2003 03:35 am, Francois Gouget wrote:
For me 0 is an integer and thus it is wrong to assign it to a pointer. The compiler agrees with me for all non-zero integers but makes an exception for 0; 'for convenience's sake', or perhaps for historical reasons. NULL is a pointer so that's the right thing to use to initialize a pointer.
I used to think this way years ago, but I have relaxed my position. Zero is fundamentally built into the language so deep, that playing with tricks like NULL and '\0' seem like a waste of time.
Moreover, I seem to remember some arguments sometime ago about 0 being actually preferred to NULL, at least in C++.
Bottom like, it seems to me there is little point in having a different names for the same thing: zero. In fact, I'd say it's bad from a theoretical standpoint (and no, I don't much care for the stronger typing argument, it buys you nothing in this case).
But if it makes you happy... :)