Casting a postdecrement operand

Ron Natalie <ron> ron at brl-sem.ARPA
Sun Jun 1 17:01:03 AEST 1986


In article <1273 at ulysses.UUCP>, jss at ulysses.UUCP (Jerry Schwarz) writes:
> In article <114 at romp.UUCP> lwh at 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



More information about the Comp.lang.c mailing list