Xref: utzoo comp.lang.fortran:769 comp.lang.c:10769 Path: utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!cs.utexas.edu!ut-sally!ut-emx!chpf127 From: chpf127@ut-emx.UUCP (J. Eaton) Newsgroups: comp.lang.fortran,comp.lang.c Subject: Re: Should I convert FORTRAN code to C? Summary: Say it clearyly? Keywords: language conversions, FORTRAN, c Message-ID: <3415@ut-emx.UUCP> Date: 17 Jun 88 11:46:02 GMT References: <2742@utastro.UUCP> <20008@beta.UUCP> <224@raunvis.UUCP> Organization: The University of Texas at Austin, Austin, Texas Lines: 31 In article <224@raunvis.UUCP>, kjartan@raunvis.UUCP (Kjartan Pierre Emilsson Jardedlisfraedi) writes: > > [stuff deleted about dynamic memory allocation] > > For this particuliar > data structure, the subroutine is basically a one-liner: > > double **Create2DArray(w,h) > int w,h;{ double **r; > for(r=(double**)calloc(h,sizeof(*r));h-->0;r[h]=(double*)calloc(w,sizeof(**r))); > return(r);} > > This may look very cryptic but then you only write it once anyway! Yes, perhaps, but you (and, most likely, someone else) will have to read it more than once. Will that future reader be able to quickly grasp what is being done (especially if that future person is a scientific "programmer")? > Say it in any language you like, but say it clearly! I agree. > Kjartan Pierre Emilsson, Iceland. J. Eaton UT Dept of Chemical Engineering Practice what you preach.