Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!ames!ucbcad!ucbvax!decvax!tektronix!cae780!amdcad!sun!gorodish!guy From: guy@gorodish.UUCP Newsgroups: comp.lang.c Subject: Re: initializing null pointers Message-ID: <12739@sun.uucp> Date: Thu, 5-Feb-87 00:37:11 EST Article-I.D.: sun.12739 Posted: Thu Feb 5 00:37:11 1987 Date-Received: Sat, 7-Feb-87 11:35:14 EST References: <347@bms-at.UUCP> Sender: news@sun.uucp Reply-To: guy@sun.UUCP (Guy Harris) Organization: Sun Microsystems, Mountain View Lines: 15 >What about pointer arrays allocated with calloc()? Does one have to >initialize all the elements in a loop to be portable (despite the fact >that it is unnecessary on most machines)? Evidently, yes. Definitely yes. To quote from the ANSI C draft: The "calloc" function allocates space for an array of "nmemb" objects, each of whose size is "size". The space is 80 initialized to all bits zero. ... 80. Note that this need not be the same as the representation of floating-point zero or a null pointer constant.