Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ulysses.UUCP Path: utzoo!watmath!clyde!burl!ulysses!jss From: jss@ulysses.UUCP (Jerry Schwarz) Newsgroups: net.lang.c Subject: Re: Casting a postdecrement operand Message-ID: <1295@ulysses.UUCP> Date: Sun, 15-Jun-86 15:10:53 EDT Article-I.D.: ulysses.1295 Posted: Sun Jun 15 15:10:53 1986 Date-Received: Tue, 17-Jun-86 10:49:35 EDT References: <114@romp.UUCP> <2842@utcsri.UUCP> <1273@ulysses.UUCP> <786@steinmetz.UUCP> Organization: AT&T Bell Laboratories, Murray Hill Lines: 19 > > The variable 'cbap' is a pointer. The cast '(struct abc *)' is a > pointer cast. I can use '((struct abc *)cbap)' with indirects and > subscripts and anywhere that I can use an Lvalue, so I really believe > that the expression is legal. > -bill davidsen Being a pointer value is not the same as being an lvalue. The places that require lvalues are left hand side of assignments, and operands of the increment and decrement operations. In none of these locations is '((struct abc*)cbap)' legal. If p is an expression with a (data) pointer type then *p will be an lvalue, so ++ *((struct abc**)&cbab) will modify cbab. Jerry Schwarz Bell Labs, MH