UINT x = 0;
[a loop]
x++;
[end of the loop]
The program seems to work correctly, but when I debug my program the value of x is always 0...
Even if I write this:
x = 20;
x is always = 0.
Any idea of what might be causing this??
UINT x = 0;
[a loop]
x++;
[end of the loop]
x = 20;
int x = 0;
{
int x = 0;
++x;
}
more context would be helpful. If you std::cout (or printf in C) x, does it show the correct value?
//k = 7
UINT mN = pow(2.0f, k) - 1;
UINT mM = (mN + 1)/4;
Are you debugging a release build?
mM get a weird value like -858993460, but everything is rendered correctly and if I output mM the value is correct...
[quote name='Hodgman' timestamp='1308187153' post='4823878']
Are you debugging a release build?
This suggests to me that your breakpoint is not far enough along in your code. If I'm correct try setting the breakpoint to the next line after UINT mM = (mN + 1)/4; . Then you should see mM take the correct value.