🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2659

Re: More Re: Function Argument Evaluation argument

#2659
From: Roy Johnson
Date: Mon, 01 Apr 1991 20:21
30 lines
1292 bytes
I understand that the comma operator is a sequence point.
If we use the comma operator as a sequence point between evaluations:

   int v=1;
   printf("%d %d\n", (1, v), (1,v++));

This can print
	1 1
or
	2 1
if I understand it right, which I very well may not.

Similarly,

   char *x="foo", *y="bar", *p;
   p=x;
   printf("%s %s\n", (1, (p=y)), (1, p));

can print

	foo bar
or

	bar bar

Do I win?  8^)
--
======= !{sun,psuvax1,bcm,rice,decwrl,cs.utexas.edu}!shell!rjohnson =======
Feel free to correct me, but don't preface your correction with "BZZT!"
Roy Johnson, Shell Development Company
Technical Details
Message-ID: <RJOHNSON.91Apr1142143@olorin.shell.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!bcm!shell!shell!rjohnson
References: <17936@crdgw1.crd.ge.com> <15607@smoke.brl.mil> <17983@crdgw1.crd.ge.com> <3547@inews.intel.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!bcm!shell!shell!rjohnson
From: rjohnson@shell.com (Roy Johnson)
Newsgroups: comp.std.c
Subject: Re: More Re: Function Argument Evaluation argument
Message-ID: <RJOHNSON.91Apr1142143@olorin.shell.com>
Date: 1 Apr 91 20:21:43 GMT
References: <17936@crdgw1.crd.ge.com> <15607@smoke.brl.mil>
 <17983@crdgw1.crd.ge.com> <3547@inews.intel.com>
Sender: usenet@shell.shell.com (USENET News System)
Organization: Shell Development Company, Bellaire Research Center, Houston, TX
Lines: 30
In-Reply-To: bhoughto@pima.intel.com's message of 29 Mar 91 06:13:49 GMT