Chad said:
What about the following...
http://67.40.109.61/torek/c/expr.html
And I quote..
"Array objects have a special, fundamental rule in C. This rule is
essentially arbitrary, and simply must be memorized. It falls out
from a key fact: C does not have array values. (There is one
exception to this, which I will save for later.) C does have array
objects -- just the values are missing. For instance, int a[5];
declares an ordinary array containing five ints. Logically, the
‘value’ of this array ought to be the five int values stored in that
array -- but it is not. Instead, the ‘value’ of the array is a
pointer to the first element of that array. "
The point being that, if I understand correctly, C does not have
'array of integers'. Instead, at least according to the former
comp.lang.c regular on here, the language has 'array objects'.
I find the quoted text misleading at best.
C does have array values; it just doesn't let you manipulate them
directly in most cases. The standard's definition of the word
"value" (C99 3.17) is "precise meaning of the contents of an object
when interpreted as having a speciï¬c type". Nothing in that
definition excludes arrays. Given:
int arr[5];
the value of arr consists of the values of its 5 elements,
interpreted as having type "int[5]". When you store something
into an array object, that object has a value, and that value is
an array value.
The relevant rule (stated in C99 6.3.2.1p3) is that an expression
of array type is implicitly converted to a (non-lvalue) pointer to
the array object's first element -- *unless* the array expression
is the operand of a unary "&" (address-of) or of "sizeof", or is
a string literal in an initializer used to initialize an array;
in those cases, an array expression really is an array expression.
Note that when we refer to "an array", we generally mean "an object
of array type", or equivalently "an array object".
arr, as defined above is an array object (of type int[5]). Like any
array object, it is an array of objects (those objects happen to
be of type int). More precisely, it's an array of integers (an
array of longs, or of chars, would also be an array of integers).
Even more precisely, it's an array of ints.