Consider a 2-dimensional array,
char arr[3][3] = { 'a','b','c',
'd','e','f',
'g','h','i'
};
what is the difference between,
(arr + 1) and
*(arr + 1)
The expression '(arr + 1)' yields the address
of the type 'char[3]' object (an array) whose
first element is located three bytes past the
starting address of the array 'arr'. The
expression's type is 'char(*)[3]' (pointer to
array of three characters).
*(arr + 1) yields the address of the type 'char'
object located three bytes past the starting address
of the array 'arr'. The expression's type is
'char *' (pointer to type 'char').
Thus, both expressions yield the same value (the
address of the character object with the value 'd'
in your example); however the two expressions' types
are different ('char(*)[3]' and 'char*', respectively.
(The actual address value of the two expressions will
vary among implementations, and often between different
executions of the program on the same platform)
I hope I didn't just do your classwork for you.
(If I've erred in the above, someone will be sure to
point it out.)
More info about arrays and pointers here:
http://web.torek.net/torek/c/pa.html
Other good information from Mr. Torek on C here:
http://web.torek.net/torek/c/
comp.lang.c FAQ here:
http://www.eskimo.com/~scs/C-faq/top.html
-Mike