Path: utzoo!attcan!uunet!yale!cmcl2!lanl!jlg From: jlg@lanl.gov (Jim Giles) Newsgroups: comp.lang.fortran Subject: Re: Arrays and pointers Message-ID: <4084@lanl.gov> Date: 23 Sep 88 18:51:03 GMT References: <364@raspail.UUCP> Organization: Los Alamos National Laboratory Lines: 17 From article <364@raspail.UUCP>, by bga@raspail.UUCP (Bruce Albrecht): > [...] > It's interesting that you compare the use of pointers to the use of GOTO. It is indeed. Hoare pointed out that when you compare control structures to data structures, the GOTO is isomorphic to the pointer. I don't think this observation is original to Hoare, but it's true whoever originated it. J. Giles Los Alamos> The argument against the GOTO is that unrestricted use of them tended to > result in unreadable, unmaintainable code. I think that using pointer > increment/decrement tends to produce the same result. It's more difficult > to provide bounds checking in C if you are using pointers to traverse the > array elements, and I suspect code is more obscure if the code is not > accessing each element sequentially. Nearly any random access to an array > is going to be more clearly represented using indices than by using pointers.