Mail Archives: djgpp/1997/04/24/10:55:14
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
>
- Raw text -