Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ritcv.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!rochester!ritcv!mjl From: mjl@ritcv.UUCP (Mike Lutz) Newsgroups: net.lang.c Subject: Re: SIZEOF Message-ID: <1499@ritcv.UUCP> Date: Mon, 28-Jan-85 17:41:23 EST Article-I.D.: ritcv.1499 Posted: Mon Jan 28 17:41:23 1985 Date-Received: Wed, 30-Jan-85 08:27:45 EST References: <347@ecr.UUCP> <393@rlgvax.UUCP> Organization: Rochester Institute of Technology, Rochester, NY Lines: 28 > OK. Everybody take a deep breath and repeat after me: > > THER IS NO ONE NULL ADDRESS CONSTANT IN C! > > There is no such thing as a generic "pointer" in C. Guy's right, of course. For those who want null pointers of various types, might I suggest the following macro: /* * Make a Null Pointer for objects of type 't' */ #define NullPtr(t) ( ((t) *) 0 ) This permits code like: execl( "/bin/foo", "foo", "bar", NullPtr(char) ) ; This can be quickly fixed for those who object to creating pointers to objects of type 't' but want Null pointers for (pointer) type t. With a bit of imagination, you can create macros to allocate & free objects of type 't' in a type safe fashion, using malloc/calloc/free. -- Mike Lutz Rochester Institute of Technology, Rochester NY UUCP: {allegra,seismo}!rochester!ritcv!mjl CSNET: mjl%rit@csnet-relay.ARPA