Tuesday, January 29, 2019

Prefix operator difference in C++ and C#

Let's have this piece of code:




int a = 1;
int b = ++a + ++a;


In C++ (VS 2010) the result is: b = 6
but in C# the result is: b = 5



What's going on there? Why are the results different?

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...