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

Liber nevin1 at ihlpb.ATT.COM
Fri Jan 6 11:10:20 AEST 1989


In article <46929 at yale-celray.yale.UUCP> ashcraft at yale-celray.UUCP (Cleve Ashcraft) writes:

|"zero-fills the area" how? for ints? floats? doubles?

It sets all the bits to 0.

|i've got in the habit of malloc'ing everything and then zeroing
|(appropriatly) the data if needed.

This usually leads to a more portable program, which is generally a good
thing.
-- 
 _ __	NEVIN ":-)" LIBER  nevin1 at ihlpb.ATT.COM  (312) 979-4751  IH 4F-410
' )  )			 "I will not be pushed, filed, stamped, indexed,
 /  / _ , __o  ____	  briefed, debriefed or numbered!  My life is my own!"
/  (_</_\/ <__/ / <_	As far as I know, these are NOT the opinions of AT&T.



More information about the Comp.lang.c mailing list