Gernot Frisch posted:
>
> "JKop" <> schrieb im Newsbeitrag
> news:ZgIid.40966$...
>>
>> void Blah(int k) { k; }
>>
>>
>> int main()
>> {
>> int a;
>> int b;
>>
>> Blah( ++a, ++b ); }
>>
>>
>> Is there any rules to say in what way a comma is interpreted within
>> function arguments?
>>
>> If I were to guess, I'd say that it's always interpreted as an
>> argument seperator, except when enclosed in its own brackets, as in:
>>
>>
>> void Blah(int k) { k; }
>>
>>
>> int main()
>> {
>> int a;
>> int b;
>>
>> Blah( (++a, ++b) ); }
>>
>>
>> But then again I'm just guessing!
>
> The , is an operator with highest prescendence (will be evaluated at
> very last, even after braces). It simply divides operations, but does
> not change the lvalue nor the rvalue.
>
> Common example:
> for (int i=0, j=5; i<5; i++, j++) {}
>
> Was that your question?
> -Gernot
Consider a function that takes ONE argument. You call it as so:
Func( a, b );
What are the rules to dictate whether the function has been supplied:
A) Two arguments
- First argument: a
- Second argument: b
B) One argument
- First argument: a, b
-JKop
|