0
Can anyone give detail explanation with an example of multiple assignment operators like X+=y-=10
2 Antworten
+ 3
Here in your example:
Every where in a program, RHS expressions are evaluated first.
So like this if X=20,y=30;
(X+=(y-=10))
X+=(y-=10)
=>X=X+(y-=10)
=>X=X+(y=(y-10));
=>X=X+(y=30-10);
X=X+(y=20);
X=X+20;
X=20+20;
X=40
Edit: in c,c++,java...
0
These things can be slightly different in different languages.
The keyword you have to google for here (in combination with your language) is:
operator precedence