Path: utzoo!attcan!uunet!lll-winken!lll-ncis!lll-lcc!ames!haven!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: Re: Comma Operator Keywords: order of evaluation, comma operator, function call Message-ID: <15467@mimsy.UUCP> Date: 14 Jan 89 14:04:16 GMT References: <922@quintus.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 14 In article <922@quintus.UUCP> nair@quintus writes: >What should this print? > > int x, y; > printf("%d %d\n", (x = 1, y = 2), x, y); (presumably there is one `%d' missing here.) Nothing certain. The invocation contains two commas and *one* comma operator. The order of evaluation of the one comma operator is guaranteed, but the order of the whole mess is not. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris