operators computing direction
<p>I encountered something that I can't understand.</p>

<p>I have this code:</p>

<pre><code>cout &lt;&lt; "f1 * f1 + f2 * f1 - f1 / f2 is: "&lt;&lt; f1 * f1 + f2 * f1 - f1 / f2 &lt;&lt; endl;
</code></pre>

<p>All the "f"s are objects, and all the operators are overloaded.</p>

<p>The weird this is that the first computation is of the <code>/</code> operator,
then the second <code>*</code> and then the first <code>*</code>; after that, the operator <code>+</code> and at last, operator <code>-</code>.</p>

<p>So basically, the <code>/</code> and <code>*</code> worked from right to left,
and the <code>+</code> and <code>-</code> operators worked from left to right.</p>

<p>I made another test...
I checked this code:</p>

<pre><code> cout &lt;&lt; "f1 * f1 / f2 is: " &lt;&lt; f1 * f1 / f2 &lt;&lt; endl;
</code></pre>

<p>Now, the first operator was <code>*</code> and only then operator <code>/</code>.
So now, it worked from left to right.</p>

<p>Can someone help me understand why is there difference in the directions?</p>

<p>10X!</p>
