Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Abandon NULL for (0) Message-ID: <1989Oct6.164012.5623@utzoo.uucp> Organization: U of Toronto Zoology References: <252B5E41.1244@marob.masa.com> Date: Fri, 6 Oct 89 16:40:12 GMT In article <252B5E41.1244@marob.masa.com> daveh@marob.masa.com (Dave Hammond) writes: >#define NIL(t) (t *)0 > >This produces fairly readable and maintainable code, as in: > >if (fp == NIL(FILE)) Is there some reason why this is superior to `if (fp == (FILE *)NULL)' or just `if (fp == NULL)'? You don't need that cast anywhere except in an argument to a function (in the absence of ANSI C prototypes). -- Nature is blind; Man is merely | Henry Spencer at U of Toronto Zoology shortsighted (and improving). | uunet!attcan!utzoo!henry henry@zoo.toronto.edu