pointers to arrays

Karl Heuer karl at haddock.ima.isc.com
Wed Feb 22 05:17:48 AEST 1989


In article <1052 at auspex.UUCP> guy at auspex.UUCP (Guy Harris) writes:
>No, just because you can get a pointer to an array doesn't mean you can put
>an array on the LHS of an assignment; not all things you can apply the &
>operator to are lvalues.

Correction.  `lvalue', as the term is used in the dpANS, does not mean
`something that can appear on the LHS of an assignment'.  In fact arrays
*are* lvalues in ANSI C.

Lvalues include two flavors of things that cannot be assigned (arrays and
consts), and two flavors of things that have no address (bitfields and
registers).  A `register const' is neither addressible nor assignable, but
it's still an lvalue.

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.lang.c mailing list