Re: Method call args order
Re: Method call args order
- Subject: Re: Method call args order
- From: "Simon Raisin" <email@hidden>
- Date: Sat, 30 Sep 2006 08:06:41 -0400
This is humorous as some time ago we used this exact question during technical interviews. We didn't care if you got the "right" answer or not, it was just interesting to hear some of the "answers" we recieved. :)
On 9/25/06, R. Matthew Emerson <email@hidden> wrote:
On Sep 25, 2006, at 11:50 AM, Jean-Daniel Dupas wrote:
> Is it always true for C language?
Yes. The order of function argument evaluation is undefined in C.
http://cm.bell-labs.com/cm/cs/who/dmr/clcs.html is an old paper that
talks about the rationale for this. See the section "Effects on the
Language" near the end of the paper.
> Le 25 sept. 06 à 17:46, David A Rowland a écrit :
>
>> At 4:12 PM +0100 9/25/06, Paul Walmsley wrote:
>>>> I have problems with this function call:
>>>>
>>>> int i=0;
>>>> printf("Format %i, %i\n", i++, i++);
>>> The order of evaluation of function arguments is undefined in C+
>>> +, so there is no guarantee which of the i++ gets evaluated
>>> first. See Item 31 in Sutter & Alexandrescu's 'C++ coding
>>> standards'. This is exactly the example they give that is not
>>> guaranteed to work.
>>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden