Path: utzoo!attcan!uunet!lll-winken!lll-ncis!lll-lcc!ames!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Comma Operator Keywords: order of evaluation, comma operator, function call Message-ID: <9367@smoke.BRL.MIL> Date: 14 Jan 89 12:33:24 GMT References: <922@quintus.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 13 In article <922@quintus.UUCP> nair@quintus () writes: >What should this print? > printf("%d %d\n", (x = 1, y = 2), x, y); "Warning -- missing format specifier for one argument". >Is there any justification in the first one printing > 2 1 0 [Assuming the format spec was fixed.] The order in which arguments to functions are evaluated is intentionally unspecified. Some implementations do it one way, some another. In your case it appears that they were evaluated right-to-left.