Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version nyu B notes v1.5 12/10/84; site acf4.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!cmcl2!acf4!greenber From: greenber@acf4.UUCP (ross m. greenberg) Newsgroups: net.lang.c Subject: Re: runtime 'sizeof()'? Message-ID: <800002@acf4.UUCP> Date: Sun, 27-Jan-85 18:16:00 EST Article-I.D.: acf4.800002 Posted: Sun Jan 27 18:16:00 1985 Date-Received: Tue, 29-Jan-85 06:58:32 EST References: <33@gitpyr.UUCP> Organization: New York University Lines: 38 <> What I always have is a little .h file: = = = = = = = = = = = #ifndef NULL #define NULL (int) 0 #endif #ifndef NULLP #define NULLP (char *)NULL #endif = = = = = = = = = = = Aside from being "portable", it really makes code easier to read because you know which are apples and which are pears. I also go the whole way with additional NULLs defined (NULLL, NULLS, NULLD, NULLF, etc.), because this won't always work: long var; if (var == NULL) {stuff} Then of course the question is, will this work: long var; if (var) {stuff} I've found that it doesn't always (flaky compilers!), so I have made my code (when needed): long var; if (var != NULLL) {stuff} Sloppy, but portable!!! (and easy to understand, even for me!) Didn't we have this discussion about three months ago?? ------------------------------------------------------ Ross M. Greenberg @ NYU ----> { allegra,ihnp4 }!cmcl2!acf4!greenber <----