So which of the rules of the game does this example break, then?
1 2 3 4 5 6 7 8 9
#include<iostream>
usingnamespace std;
int main()
{
int value;
value = 2; value = value * 2 / 3; cout << value << endl;
value = 2; value *= 2 / 3; cout << value << endl;
}
I'm well aware why the answers are what they are; (the consequences of integer division - deliberately chosen for this example). It wasn't meant as a frivolous post, and I wasn't off my head when conjuring it up!
I'm posting this as a salutary warning that you can't simply substitute value *=
for value = value *
... and because I managed to fall victim to it myself three times in an hour when I decided to "tidy up" some code previously written in a different programming language.