Int a = 5; a = a++ + ++a; a =? (2011)
3 points
1/21/1970
a day ago
by e-topy
Comments
magicalhippo
a day ago
Tomte
Some C++ quiz with ++a and a++? It‘s always about sequence points, or better the lack of sequence points.
It‘s the standard technical C++ blog post everybody seems to write.
a day ago
nDRDY
Oh god. How long before yet another UB-based question ends up in technical coding interviews?
a day ago
Perhaps I'm just naive and/or have forgotten too much C, not that I knew that much, but I'm a bit perplexed as to why this is UB.
It seems like something that should trigger a "we should specify this" reaction when adding these operators, and there is at least one reasonable way to define it which is fairly trivial and easily implementable.