Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun-barr!sun!plx!evan From: evan@plx.UUCP (Evan Bigall) Newsgroups: comp.lang.c Subject: Is this portable? Message-ID: <1914@plx.UUCP> Date: 9 May 89 16:39:31 GMT Reply-To: evan@plx.UUCP (Evan Bigall) Organization: Plexus Computers; San Jose, CA Lines: 18 This works on my machine, but I am curious as to whether it is "officially" correct and portable C. I can think of some machines where it could be trouble main() { int array[10], *ptr, j; for(j=0; j<10; j++) array[j]=j; ptr= &array[1]; for(j= -1; j<9; j++) printf("%d\n", ptr[j]); } This is a contrived example, in context it makes a lot more sense. Evan