|
-
July 7th, 2009, 10:17 AM
#1
Debug works, Release doesn't?
I came across this in my MFC app and simplified the code into this console app for this example. When I compile and run the following code in Debug mode, it gives the correct answer for i, (10). When I compile and run it in Release mode, it gives the wrong answer for i, (11). Anyone know why?
Code:
#include <iostream>
using namespace std;
void main(){
int i;
double yTest;
i=0;
yTest = 100000000.;
while (yTest-.01 > 0.){
yTest /= 10.;
i++;
}
cout<<i<<endl;
}
VS 2003 .Net Version 7.1.3088
Regards,
Lowell
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|