I am testing an algorithm that I cut and pasted out
of the book "Numerical Recipes in C" which should be
guaranteed bug free, however it wasn't
working...until I added a printf statement to line#
207 inside a for(;;) loop in the routine bsstep
(...). It doesn't matter what is printed--printf
("");--works just as well as printf("hello world");
If you comment out the printf statement, however, the
program will no longer work. Reinstalling Dev C++
didn't affect it. I have not tried running it with
Dev C++ 4.0.
The program should print the results:
result = 5.000000e+000
result = 5.400361e-002
Press any key to continue . . .
After commenting out line# 207 //printf(""); the
results are:
result = 5.000000e+000
...(the program gets stuck)
strange bug :)
program "I like it when you use printf statements"
Logged In: NO
First, this isn't a bug within Dev-Cpp. It seems this is a
Problem with your code or g++. If I compile your source with
-g3 -march=i386 (or Project Options, Compiler, Code
Generation: i386) it runs without the "207 printf".
Best regards, Andy