Path: utzoo!attcan!uunet!snorkelwacker!tut.cis.ohio-state.edu!mailrus!iuvax!rutgers!columbia!cubmol!ping From: ping@cubmol.bio.columbia.edu (Shiping Zhang) Newsgroups: comp.lang.c Subject: Re: FREE Message-ID: <1990Mar2.152601.8000@cubmol.bio.columbia.edu> Date: 2 Mar 90 15:26:01 GMT References: <2714@stl.stc.co.uk> <1990Feb27.155133.20341@druid.uucp> <16055@haddock.ima.isc.com> <1990Mar1.140829.17199@druid.uucp> Reply-To: ping@cubmol.bio.columbia.edu (Shiping Zhang) Organization: Dept. of Biology, Columbia Univ., New York, NY Lines: 28 In article meissner@osf.org (Michael Meissner) writes: [In article <1990Mar1.140829.17199@druid.uucp> darcy@druid.uucp (D'Arcy [J.M. Cain) writes: [ [| In article <16055@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes: [| >In article <1990Feb27.155133.20341@druid.uucp> darcy@druid.UUCP (D'Arcy J.M. Cain) writes: [| > [| >The calloc() function is disrecommended. Generally speaking, you should use [| >malloc() and initialize the contents yourself. [| > [| I've heard that before but not the reason. So why is it disrecommended? [ [Because there exist machines whose floating point 0.0 does not have [all bits zeroed. There are also machines where a NULL pointer does [not have all bits zeroed. Using calloc will probably work 99.99%, but [do you want to have to be the 'lucky' person who has to track down why [such a machine gives funny answers. My question is Why is NOT calloc() made machine independent. I also often asked (to myself) Why is NOT malloc() made to initialize the contents automatically? I simply can not think of any case where the initial contents would be useful for some purpose and should be preserved. Is the efficiency a matter here? -ping