Xref: utzoo comp.lang.fortran:816 comp.lang.c:10938 Path: utzoo!utgpu!water!watmath!clyde!att!rutgers!uwvax!oddjob!ncar!noao!arizona!naucse!rrr From: rrr@naucse.UUCP (Bob Rose ) Newsgroups: comp.lang.fortran,comp.lang.c Subject: Re: Variable dimensioning in fortran (now in C) Summary: Let me make myself clear. Keywords: language conversions, FORTRAN, c Message-ID: <760@naucse.UUCP> Date: 27 Jun 88 18:24:47 GMT References: <2742@utastro.UUCP> <20008@beta.UUCP> <224@raunvis.UUCP> <527@philmds.UUCP> Organization: Northern Arizona University, Flagstaff, AZ Lines: 33 In article <527@philmds.UUCP>, leo@philmds.UUCP (Leo de Wit) writes: > I write: > > Leo de Wit writes: > > > [my example using calloc() deleted] > >Close, but ... I assume you are using calloc to zero the array, but ^^^^^ The array was of double!!!!! > >the whole world is not a VAX. Try: > > > > [Bob's example using malloc() deleted] > > What makes you think calloc() is VAX-specific? I checked with K&R: > [ ... its in all the man pages and dpANS ... ] You misunderstood me. (A lot of people have been doing that lately, maybe I need a vacation :-) Calloc is available every where except on systems totally brain damaged. The thing is calloc binary zero's the memory. The array you where zeroing was of type double. Now no where does it say that the internal representation of a double must be binary zero (most machines it is, but NOT all.) This turns out to be one of those hard to find bugs when porting to an odd ball architecture. > >Just fuel for the fire. > Thanks! So I can light my cigar now 8-). > > Leo++ So did I make myself clear or should I buy you a box of cigars for the long battle ahead :^) --bob P.S. I would sure like a chapter and vers if calloc can be used to create an array of zeroed doubles.