holotko wrote:

> > > But for testing null pointers, I use `!'. In this context, it seems
> > 
> > BAD. I worked in envinronments where NULL is ((void *)-1UL). If you use !
> > to check for a NULL pointer you make your code not portable.
> 
> What is the best, all round "most portable" means of testing for a null
> pointer??

Using `!p' is sufficient. If you use `p != NULL', you need to include
stdio.h to ensure that NULL is defined, which is kind of overkill if
you're not using anything else from stdio.h.

-- 
Glynn Clements <[EMAIL PROTECTED]>

Reply via email to