/* PointerArithmetics.c (c) Kari Laitinen http://www.naturalprogramming.com/ 2013-11-25 File created. 2013-11-25 Last modification. */ #include int main() { int array_of_integers[] = { 111, 222, 333, 444, 555 } ; int* an_integer_in_array ; printf( "\n This program uses a pointer to print an initialized" "\n array. The following is the array in normal order:" "\n\n " ) ; an_integer_in_array = &array_of_integers[ 0 ] ; printf( "%d %d %d %d %d\n\n", *an_integer_in_array, *( an_integer_in_array + 1 ), *( an_integer_in_array + 2 ), *( an_integer_in_array + 3 ), *( an_integer_in_array + 4 ) ) ; printf( " And the following is the array in reverse order: \n\n " ) ; for ( an_integer_in_array = &array_of_integers[ 4 ] ; an_integer_in_array >= &array_of_integers[ 0 ] ; an_integer_in_array -- ) { printf( " %d", *an_integer_in_array ) ; } } /* Here is a sample execution of this program: This program uses a pointer to print an initialized array. The following is the array in normal order: 111 222 333 444 555 And the following is the array in reverse order: 555 444 333 222 111 */