#include /* Just an example struct */ struct foo { int i; char c; void * vp; }; int main (void) { int i; struct foo farray[10]; struct foo * fp; struct foo * ftemp; int sz = sizeof(struct foo); fp = farray; ftemp = fp; /* the pointer now points to farray */ printf ("\nSize of struct foo = %i\n", sz); printf ("Address of farray = %x\n", (int) farray); printf ("Address of fp = %x\n\n", (int) fp); printf ("Now going to do each address...\n"); for (i = 0; i < 10; i++) { printf ("Address of fp[%i] = %x\n", i, (int)fp); printf ("Compare to fp + %i * sizeof(foo) = %x\n", i, (int)ftemp + i * sz); if ((int)fp == (int)ftemp + i * sz) printf (" Check!\n\n"); else printf (" No Dessert for you!\n"); fp++; } printf ("The addresses should all be the same :)\n\n"); return 0; }