On Thursday 21 April 2005 22:31, Randall R Schulz wrote:
Michael,
On Thursday 21 April 2005 02:48, Michael Stevens wrote:
...
In C++ it would seem that the 'const void * NULL = 0' definition would be a good thing as opposed to the literal '0' which Bjarne is recommending.
I used these routinely in my C++ work:
const void *NIL = 0; const char NUL = 0;
I would use a naked 0 in source code only where the context was actually integer, not pointer or character, in which case I'd use on of these.
Michael
Randall Schulz
I like this idea - it makes it clear about what you mean, whereas (to me anyway) there is always confusion with NULL which is not even NUL. How do you write that a pointer ptr is pointing nowhere? That is, the value of the pointer is zero. I mean so that it is clear that it is not pointing to a zero value. Pardon my ignorance, but my preference is for FORTRAN and we are positively discouraged from using pointers because all of our variables are in fact addresses (pointers) and not 'values' as in C. Regards, Colin Colin