Why &array is not allowed

Kendall kendall at wjh12.UUCP
Wed Aug 17 11:03:51 AEST 1983


The V7 Ritchie compiler does indeed allow &array, but this is a bug.
The C manual states, "Every time an identifier of array type appears
in an expression, it is converted into a pointer to the first member
of the array.  Because of this conversion, arrays are not lvalues."
(section 14.3)  (The word "identifer" should actually be changed to
the word "expression".)  The unary & operator is not excepted from
this rule; thus, &array makes no sense, since & can apply only to
lvalues.

	Sam Kendall			{allegra,ihnp4}!wjh12!kendall
	Delft Consulting Corporation	  decvax!genrad!wjh12!kendall



More information about the Comp.lang.c mailing list