C++ - Post increment logic in Numeric expressions | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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 Respostas
+ 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