C++ - Post increment logic in Numeric expressions | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

C++ - Post increment logic in Numeric expressions

Where error in my logic? https://code.sololearn.com/cFtbZbbbc8wO/?ref=app

9th Jun 2019, 6:22 PM
Michail Getmanskiy
Michail Getmanskiy - avatar
2 Answers
+ 3
Robin : Thank. I agree.
9th Jun 2019, 8:11 PM
Michail Getmanskiy
Michail Getmanskiy - avatar
+ 2
I understand. I myself would never write code like this. But the fact is that the behavior of the program code is not very obvious in this case (behavior of the i ++ / i execution point - (Post Increment / Decrement). Behavior is different in Java and in C ++. In other languages (I did not check versions of the compiler) And I asked myself a question after a couple of top three local tests on this topic. And it became just interesting. Therefore, I asked the question: “maybe someone knows the correct answer to such a question?”.
9th Jun 2019, 7:13 PM
Michail Getmanskiy
Michail Getmanskiy - avatar