Related articles |
---|
C Pointer Arithmetic -> Array Reference gagnon@bluebeard.cs.mcgill.ca (Etienne GAGNON) (1994-09-17) |
Re: C Pointer Arithmetic -> Array Reference schooler@apollo.hp.com (1994-09-19) |
Newsgroups: | comp.compilers |
From: | Etienne GAGNON <gagnon@bluebeard.cs.mcgill.ca> |
Keywords: | C, optimize, question |
Organization: | Compilers Central |
Date: | Sat, 17 Sep 1994 22:40:04 GMT |
Hi,
Does anyone know about books, articles or papers written on
converting pointer arithmetic to array reference automatically?
e.g.: main() ===>> main()
{ {
int a[100]; int a[100];
int *p; int *p;
int i; int i;
p = a; p = a;
for( i=0; i<100; i++ ) for( i=0; i<100; i++ )
{ {
*p = 0; ===>> /* pointer arithmetic p++ removed */
p++; ===>> a[i] = 0; /* or p[i]=0 */
} }
} }
Thank you for help.
- Etienne
e-mail: gagnon@acaps.cs.mcgill.ca
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.