Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!caip!brl-adm!brl-smoke!brl-sem!ron From: ron@brl-sem.ARPA (Ron Natalie ) Newsgroups: net.lang.c Subject: Re: Casting a postdecrement operand Message-ID: <266@brl-sem.ARPA> Date: Sun, 1-Jun-86 03:01:03 EDT Article-I.D.: brl-sem.266 Posted: Sun Jun 1 03:01:03 1986 Date-Received: Fri, 20-Jun-86 04:07:23 EDT References: <114@romp.UUCP> <2842@utcsri.UUCP> <1273@ulysses.UUCP> Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 16 In article <1273@ulysses.UUCP>, jss@ulysses.UUCP (Jerry Schwarz) writes: > In article <114@romp.UUCP> lwh@romp.UUCP (lwh) writes: > > ((struct abc *)cbap)++; > >to increment cbap by 500. It appears that the ANSI standard doesn't say > >anything about the legality of this syntax. > > "++" requires an lvalue. A cast produces a value but not an lvalue, > so this is not legal in ANSI (or in K&R ) C. I find this disgusting but ( *((struct abc **)&cbap) )++; would work. INEWS SUCKS INEWS SUCKS INEWS SUCKS INEWS SUCKS