Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!mentor.cc.purdue.edu!l.cc.purdue.edu!cik From: cik@l.cc.purdue.edu (Herman Rubin) Newsgroups: comp.lang.c Subject: Re: Contiguous Arrays Summary: Use a struct Message-ID: <1146@l.cc.purdue.edu> Date: 23 Feb 89 15:09:49 GMT References: <2508@ssc-vax.UUCP> <8943@alice.UUCP> <1828@valhalla.ee.rochester.edu> <1831@valhalla.ee.rochester.edu> Organization: Purdue University Statistics Department Lines: 24 In article <1831@valhalla.ee.rochester.edu>, badri@valhalla.ee.rochester.edu (Badri Lokanathan) writes: > > In article <1828@valhalla.ee.rochester.edu>, I said | < > In article <1989Feb22.171441.7957@utzoo.uucp>, > henry@utzoo.uucp (Henry Spencer) writes: > > No one couldn't, not if one wants to be portable. There is absolutely no > > guarantee that x[101] will be the same as space[0], and in fact there is > > no guarantee that the computation of x won't trap and give you a core dump. The desired effect should be obtainable by a struct. But what is really wanted here is the Fortran EQUIVALENCE statement to guarantee that the right thing is done. Another way that this can be done is to use some assembler code to force the arrays to line up. Why do language gurus work so hard to keep us from doing the obvious? -- Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907 Phone: (317)494-6054 hrubin@l.cc.purdue.edu (Internet, bitnet, UUCP)