Path: utzoo!attcan!uunet!ingr!crossgl From: crossgl@ingr.UUCP (Gordon Cross) Newsgroups: comp.lang.c Subject: Re: A curriosity in the C compiler... Summary: a = b == c is treated as a = (b == c) Message-ID: <2775@ingr.UUCP> Date: 31 Oct 88 17:30:25 GMT References: <530@uvicctr.UUCP> Organization: Intergraph Corp. Huntsville, Al Lines: 16 In article <530@uvicctr.UUCP>, sbanner1@uvicctr.UUCP (S. John Banner) writes: > > /* > This is a quick test of the C compiler, for implied bracketing... > This will determine if the expression "a = b == c" is parsed > as "(a = b) == c" (which is correct), or as "a = (b == c)" (which > is not). > */ The correct treatment of the expression a = b == c is a = (b == c) and NOT (a = b) == c!! Check your info on operator precedence. I believe that you will discover that == has higher precedence than =. Gordon Cross Intergraph Corp. Huntsville, AL