Content deleted Content added
→Separate C and C++?: reply |
Mateen Ulhaq (talk | contribs) →Notes: new section |
||
Line 299:
}
</source>
== Notes ==
From [[Operators_in_C_and_C%2B%2B#Notes]]:
"* For example, <code>++x*3</code> is ambiguous without some precedence rule(s). The precedence table tells us that: <tt>x</tt> is 'bound' more tightly to <tt>++</tt> than to <tt>*</tt>, so that whatever <tt>++</tt> does (now or later—see below), it does it ONLY to <tt>x</tt> (and not to <code>x*3</code>); it is equivalent to (<code>++x</code>, <code>x*3</code>)."
<s>This looks like it is saying that <code>++x*3</code> is equivalent to <code>(++x, x*3)</code>. Which is incorrect: with the comma operator, the arguments can be evaluated in any order.</s>
EDIT: I wasn't aware of [http://stackoverflow.com/questions/54142/c-comma-operator/114404#114404 sequence points].
Nevermind! :)
[[User:Muntoo|Muntoo]] ([[User talk:Muntoo|talk]]) 23:21, 1 November 2011 (UTC)
|