Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!amdcad!ames!amelia!lemming.nas.nasa.gov!fouts From: fouts@lemming.nas.nasa.gov.nas.nasa.gov (Marty Fouts) Newsgroups: comp.lang.fortran Subject: Re: RE: An array by any other name. . . Message-ID: <1001@amelia.nas.nasa.gov> Date: 16 Sep 88 16:55:55 GMT References: <3641@lanl.gov> <7066@megaron.arizona.edu> <14997@ames.arc.nasa.gov> Sender: news@amelia.nas.nasa.gov Reply-To: fouts@lemming.nas.nasa.gov.nas.nasa.gov (Marty Fouts) Organization: NASA Ames Research Center Lines: 24 In article <14997@ames.arc.nasa.gov> lamaster@ames.arc.nasa.gov.UUCP (Hugh LaMaster) writes: > >. . . Indexing pointers through data structures is the path to >perdition. What happens when you move your code to a word addressable >machine, or a machine with different alignment rules? My code works just fine when I do this. It is possible to misuse pointers, but if you use the model that pointers are pointers to objects, and do pointer arithmetic rather than integer arithmetic on your pointers, You don't get alignment or word size dependencies in pointer code if you do pointer arithmetic. Pointers can be a semantic problem because they alias multiple names to the same object and make code more difficult to understand, but even this can be gotten around by careful use. (Wirth suggests only using pointers to point at anonymous objects and coercing pointers to be able to only point to one type of object.) Marty +-+-+-+ I don't know who I am, why should you? +-+-+-+ | fouts@lemming.nas.nasa.gov | | ...!ames!orville!fouts | | Never attribute to malice what can be | +-+-+-+ explained by incompetence. +-+-+-+