That is a poor example. Though equivalent in a mathematical sense, the addition (+) operator is left associative.
So 1 + 2 + 3 + 4 (I assume you intended to put a 4 there) is really (((1+2) + 3) + 4).
A C style cast is right associative, and your last statement is correct.
I thought all of the operators worked left to right. Or right to left.. or whatever. I was thinking of << and figured that + was the same. And yeah, I meant to have a 4 there.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.