Is malloc() or calloc() "better"?

Andrew Hume andrew at alice.UUCP
Fri Jan 6 14:12:50 AEST 1989



one (admittedly weak) reason for using calloc is that it
insulates you from 16-bit int compilers on 32-bit pointer machines.
calloc(1024, 1024) gives you 1MB with 16 or 32 bit ints
whereas malloc(1024*1024) may give you none.



More information about the Comp.lang.c mailing list