Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!linus!decvax!harpo!ihnp4!inuxc!pur-ee!uiucdcs!parsec!smu!pedz
From: pedz@smu.UUCP
Newsgroups: net.lang.c
Subject: Precedence Question - (nf)
Message-ID: <5518@uiucdcs.UUCP>
Date: Thu, 9-Feb-84 23:08:33 EST
Article-I.D.: uiucdcs.5518
Posted: Thu Feb  9 23:08:33 1984
Date-Received: Sat, 11-Feb-84 06:16:21 EST
Lines: 20

#N:smu:13800001:000:747
smu!pedz    Feb  9 00:17:00 1984

I have a small question for you C people.  We were writting a
compiler for C and came accross this interesting problem.  Is the
statement:
	cat = foo ? fu = bar : mouse;

legal?  Specifically the assignment operator (which has lower
precedence than the ?: thing) between the ? and the :.  If it
is legal, at what point does bar get assigned to fu, before or
after the assignment to cat?  If after (since it has lower
precedence) then I would assume cat is assign the value of fu, after
which fu is assigned the value of bar.  Right or wrong.  Note, the
VAX C compiler accepts it and its actions can easily be determined.
That is not the question.  The question is "according to K & R ...".

Respond vai mail and I will post.
Perry
parsec!smu!pedz