Path: utzoo!utgpu!watmath!clyde!att!rutgers!cmcl2!nrl-cmf!ames!mailrus!cornell!rochester!kodak!scotty!jwr From: jwr@scotty.UUCP (Jim Reid) Newsgroups: comp.lang.c Subject: Re: pointers, tests, casts Message-ID: <655@scotty.UUCP> Date: 2 Dec 88 19:39:00 GMT References: <11130@dartvax.Dartmouth.EDU> <494@auspex.UUCP> <3340@tekcrl.CRL.TEK.COM> Reply-To: jwr@scotty.UUCP (Jim Reid) Organization: Systems Integration, Eastman Kodak Co, Rochester, NY Lines: 19 In article danw@tekchips.CRL.TEK.COM (Daniel E. Wilson) writes: > > I tend to avoid the whole problem by defining a simple macro. Simply >by using this macro always I get a NULL pointer of the needed type. >This does avoid bugs. > > #define NIL(type) ((type *) NULL) If you were the person who originally posted this macro a couple of years ago, I'd personally like to thank you for it. I've been using it in my code ever since. I haven't come across a better all-purpose pointer type. -- Jim Reid {ames,harvard,rutgers}!rochester!kodak!scotty!jwr --