When I had this code, a and b's value never increases.
for( int i=0, double a=0.0, double b=0.0 ; i<100; a+=0.1, b+=0.2 )
{
printf( "%s\n", i+a+b );
}
This works, however:
double a=0.0, b=0.0;
for( int i=0 ; i<100; a+=0.1, b+=0.2 )
{
printf( "%s\n", i+a+b );
}
I used visual c++ 6.0
Damn it took me four hours to catch this. Of course, my original code
is whole lot more complicated.
Is there a way to print text to a console window even if your project
is "win32 application"?
for( int i=0, double a=0.0, double b=0.0 ; i<100; a+=0.1, b+=0.2 )
{
printf( "%s\n", i+a+b );
}
This works, however:
double a=0.0, b=0.0;
for( int i=0 ; i<100; a+=0.1, b+=0.2 )
{
printf( "%s\n", i+a+b );
}
I used visual c++ 6.0
Damn it took me four hours to catch this. Of course, my original code
is whole lot more complicated.
Is there a way to print text to a console window even if your project
is "win32 application"?
Comment