Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!uunet!virtech!cpcahil From: cpcahil@virtech.UUCP (Conor P. Cahill) Newsgroups: comp.lang.c Subject: Re: Creating pointer with all bits 0 (was: Referencing NULL pointers) Message-ID: <1104@virtech.UUCP> Date: 31 Aug 89 16:49:58 GMT References: <1989Aug31.052756.18524@sq.sq.com> Organization: Virtual Technologies Inc Lines: 25 In article <1989Aug31.052756.18524@sq.sq.com>, msb@sq.sq.com (Mark Brader) writes: > > int *p; > memset ((void *) p, 0, sizeof p); This would probably drop core on most systems. You probably want to do something like: memset ((void *) &p, 0, sizeof p); ^^ > Or bzero() if you have that and not memset(), or for that matter > there's the trickier but more universally available way: > > strncpy ((char *) p, "", sizeof p); Yet again, you need the & on the p. -- +-----------------------------------------------------------------------+ | Conor P. Cahill uunet!virtech!cpcahil 703-430-9247 ! | Virtual Technologies Inc., P. O. Box 876, Sterling, VA 22170 | +-----------------------------------------------------------------------+