/*-------------------------------------------------------------------*/ /* revp1.c */ /* The relationship between arrays and pointers. */ /*-------------------------------------------------------------------*/ #include enum {ARRAYSIZE = 5}; int main(void) /* Read ARRAYSIZE integers from stdin, and write them in reverse order to stdout. Return 0. */ { int aiNumbers[ARRAYSIZE]; int i; printf("Enter %d integers:\n", ARRAYSIZE); for (i = 0; i < ARRAYSIZE; i++) scanf("%d", aiNumbers + i); printf("\n"); printf("The integers in reverse order are:\n"); for (i = ARRAYSIZE - 1; i >= 0; i--) printf("%d\n", *(aiNumbers + i)); return 0; }