Assignments failing

Posted by Andrei Krotkov on Stack Overflow See other posts from Stack Overflow or by Andrei Krotkov
Published on 2009-06-01T19:23:27Z Indexed on 2010/05/31 4:52 UTC
Read the original article Hit count: 340

I'm debugging part of a large project in Visual Studio 2005, and stepping through the code line by line.

int speed = this->values.speed;
int ref = this->values.ref_speed;

After stepping past the first line, values.speed has a value of 61, but for some reason, speed is getting assigned the value 58. After the second line, values.ref_speed has a value of 58, but ref gets assigned the value 30.

When paused, you can see that the original values are in fact 61 and 58 respectively, but the values getting stored are different.

What is causing this behaviour?

© Stack Overflow or respective owner

Related posts about c++

Related posts about debugging