Deleting linked lists.

Scott Amspoker scott at bbxsda.UUCP
Fri Mar 29 00:58:25 AEST 1991


In article <548 at bria> uunet!bria!mike writes:
>	while ( ptr != NULL ) {
>
>Personally, I think that the [not shown] `while' is not very nice; you should
>explicitly test for NULL -- after all, a pointer is not an integer,
>right?

...and neither is a '0' when compare to a pointer which is what is implied
by 'while (ptr)'.  The C compiler will assume a compare to a null pointer
in such a case.

-- 
Scott Amspoker                       | Touch the peripheral convex of every
Basis International, Albuquerque, NM | kind, then various kinds of blaming
(505) 345-5232                       | sound can be sent forth.
unmvax.cs.unm.edu!bbx!bbxsda!scott   |    - Instructions for a little box that
                                     |      blurts out obscenities.



More information about the Comp.lang.c mailing list