Date: Thu, 24 Apr 1997 10:38:30 -0400 (EDT) From: "art s. kagel IFMX x2697" To: SteelGolem Cc: djgpp AT delorie DOT com Subject: Re: memory allocation: malloc vs. calloc In-Reply-To: <5jk1rm$la8$1@thor.atcon.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk Calloc() allocates memory then zeros it out. Malloc() returns uninitialized, read garbage filled, memory which you must initialize. BTW, for portability I prefer to use malloc() then memset()/bzero() because I have worked on two compilers with broken calloc() functions which did not properly initialize memory. The calloc() in DJGPP is fine but if you are planning on porting to other "C" compilers ... caveat emptor. Art S. Kagel, kagel AT ts1 DOT bloomberg DOT com On Wed, 23 Apr 1997, SteelGolem wrote: > what's the difference between using malloc and calloc? being a beginner > DJGPP user, should i worry about it and just use malloc? or is there > something i should know about? email and news post, pleeze! > > steelgolem >