cond. op. on ='s LHS

Chris Torek torek at elf.ee.lbl.gov
Wed Feb 20 15:44:49 AEST 1991


>throopw at sheol.UUCP (Wayne Throop) writes:
[the result of unary `*' (indirect) is always an lvalue]

In article <335 at ptcburp.ptcbu.oz.au> michi at ptcburp.ptcbu.oz.au
(Michael Henning) writes [abbreviated]:
>	int	array[10][10];
>	*array
>The type of the expression after dereferencing is "array of 10 ints", which
>is *not* an lvalue.

Technically, the result *is* an lvalue (according to ANSI terminology,
at least)---but it is not a `modifiable' lvalue.

(The type of `array' above is `array 10 of array 10 of int'; in a value
context, such as the target of unary `*', this changes to `pointer to
array 10 of int'.  The indirection changes this it `array 10 of int',
which, in an expression context, devolves to `pointer to int'.  Until
the final devolving, however, the object produced by the indirection is
a non-modifiable lvalue of type `array 10 of int'.)
-- 
In-Real-Life: Chris Torek, Lawrence Berkeley Lab EE div (+1 415 486 5427)
Berkeley, CA		Domain:	torek at ee.lbl.gov



More information about the Comp.lang.c mailing list