Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Variable dimensioning in fortran (now in C) Message-ID: <8168@brl-smoke.ARPA> Date: 27 Jun 88 03:24:24 GMT References: <2742@utastro.UUCP> <20008@beta.UUCP> <224@raunvis.UUCP> <517@philmds.UUCP> <749@naucse.UUCP> <527@philmds.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB)) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 14 In article <527@philmds.UUCP> leo@philmds.UUCP (L.J.M. de Wit) writes: >In article <749@naucse.UUCP> rrr@naucse.UUCP (Bob Rose ) writes: >>In article <517@philmds.UUCP>, leo@philmds.UUCP (Leo de Wit) writes: >>> [my example using calloc() deleted] >>Close, but ... I assume you are using calloc to zero the array, but >>the whole world is not a VAX. Try: >What makes you think calloc() is VAX-specific? It's true that calloc() exists universally, but its function is to allocate memory and initialize it with 0 BYTE data. That does not in general properly initialize all data types (particularly floating-point and pointer types), thus the necessity of malloc() followed by an explicit initialization loop. On a VAX this use of calloc() typically happens to work, by accident.