The order of evaluation of expressions is determined by the specific implementation, unless the language guarantees a certain order of evaluation. If, in addition to the result, the evaluation of an expression causes changes in the runtime environment, then it is said that this expression has side effects.In our internal mailing list about C #, a controversial question regularly arises, which concerns the correct interpretation of similar constructions:
MSDN
a -= a *= a;
p[x++] = ++x;
? , , « » (IOCCC, International Obfuscated C Code Contest), — , - . , -, a -= a *= a p[x++] = ++x; « , !»: «, ». , , , . , — 4 . , ; , , — , , .
total_cost = p->base_price + p->calculate_tax();
Source: https://habr.com/ru/post/333936/
All Articles