Why is x++ different from ++x when used in a function call?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/376278/parameter-evaluation-order-before-a-function-calling-in-c">Parameter evaluation order before a function calling in C</a><br>
  <a href="http://stackoverflow.com/questions/949433/could-anyone-explain-these-undefined-behaviors-i-i-i-i-i-etc">Could anyone explain these undefined behaviors (i = i++ + ++i , i = i++, etc…)</a>  </p>
</blockquote>



<pre><code>#include &lt;iostream&gt;
#include &lt;cmath&gt;
#include &lt;conio.h&gt;

using namespace std;
int func(int a,int b,int c){
    return a + b + c;
}
int main()
{
    int x = 100;
    cout&lt;&lt;"func(++x,++x,++x)="&lt;&lt;func(++x,++x,++x)&lt;&lt;endl;
    x = 100;
    cout&lt;&lt;"func(x++,x++,x++)="&lt;&lt;func(x++,x++,x++)&lt;&lt;endl; 
    getch();
    return 0;
}
</code></pre>

<p>The result is</p>

<pre><code>func(++x,++x,++x)=309   a = b = c = 103
func(x++,x++,x++)=303   a = 102,b = 101,c = 100
</code></pre>

<p>Why? I code it in VS2010.</p>
