Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!abcfd20.larc.nasa.gov!ipsun.larc.nasa.gov!jcburt From: jcburt@ipsun.larc.nasa.gov (John Burton) Newsgroups: comp.society.futures Subject: Re: C's sins of commission (was: (pssst...fortran?)) Message-ID: <1990Sep21.193403.20381@abcfd20.larc.nasa.gov> Date: 21 Sep 90 19:34:03 GMT References: <63722@lanl.gov> Sender: news@abcfd20.larc.nasa.gov (USENET File Owner) Organization: NASA Langley Research Center, Hampton, VA USA Lines: 36 In article <63722@lanl.gov> jlg@lanl.gov (Jim Giles) writes: >From article , by michels@cs.UAlberta.CA (Michael Michels): >> [...] Why should I be forced >> to write my programs in a cryptic form just because someone else >> has a different opinion. > >Hear, Hear!! I like a programming language to allow me to say what I >mean - not to have to convert my algorithm into something cryptic. >However, C forces me to encrypt my programs - I can't use arrays, I >have to encrypt them as pointers; I can't use dynamic memory, I have >to encrypt them as pointers; I can't use mapping (run-time equivalence), > [...] > Excuse me? are you REALLY saying you CAN'T use arrays in C without resorting to pointers??? I'm confused. Does this mean that I can't use the statement a[i][j] = 123; in a C program. If thats so, you'd better tell my C compilers that (SunOS 4.1 C compiler, Turbo C, Turbo C++...all using ANSI standard mode) Can't use dynamic memory without using pointers? Again, I assume that's not *really* what you mean...I can send you code to create 2,3,... whatever Dimensioned array you want from the heap (using malloc & calloc) that can be used in any situation where you use a statically declared one (I have yet to find a situation where it doesn't work) using exactly the same syntax. It works on all the compilers mentioned above using the ANSI standard mode. I use this routine regularly in the image processing work I do...the only problem I've run into is running out of memory for 2-D arrays larger than 1024x1024 of type float. Obviously I have misinterpreted what you are saying, perhaps you could clarify? John Burton