P
pauldepstein
I am debugging a program to price options which involves a recursive
function:
double node::get_equity(Parameter * const params_ptr, int x, int y,
const int rights)
This recursive function is behaving oddly. I made it print statements
into a debug file to try and capture the anomalous behaviour, and I did
capture something that to me (as a newbie) is very puzzling.
The function includes this block of code:
debug << endl << "This puzzles me!!";
debug << endl << "rights" << rights;
debug << endl << "That's the puzzle";
That block of 3 lines occurs consecutively. It is a brief excerpt,
yes, but nothing is left out of the middle.
The first two lines give me exactly the output I expected.
However, the third line gives me nothing. In other words, "That's the
puzzle" appears nowhere.
How can this be?
I am a beginner so don't be afraid to make suggestions that would mean
I did something stupid.
However, I was obviously printing to the debug stream successfully
because I was successful in getting the first line "This puzzles..." to
print as expected. (The 2nd line printed fine, too.)
What seems to be happening is that some of my code is simply being
ignored and I don't know why.
That block of 3 lines is part of a loop which is executed several
times. Each time, the 3rd line "That's the puzzle" is mysteriously
missing.
(I am having great trouble using the dev c++ debugger so I'm making do
without it. And yes, I did use the dev c++ help manual for the
debugger.)
Thank you for your help.
Paul Epstein
function:
double node::get_equity(Parameter * const params_ptr, int x, int y,
const int rights)
This recursive function is behaving oddly. I made it print statements
into a debug file to try and capture the anomalous behaviour, and I did
capture something that to me (as a newbie) is very puzzling.
The function includes this block of code:
debug << endl << "This puzzles me!!";
debug << endl << "rights" << rights;
debug << endl << "That's the puzzle";
That block of 3 lines occurs consecutively. It is a brief excerpt,
yes, but nothing is left out of the middle.
The first two lines give me exactly the output I expected.
However, the third line gives me nothing. In other words, "That's the
puzzle" appears nowhere.
How can this be?
I am a beginner so don't be afraid to make suggestions that would mean
I did something stupid.
However, I was obviously printing to the debug stream successfully
because I was successful in getting the first line "This puzzles..." to
print as expected. (The 2nd line printed fine, too.)
What seems to be happening is that some of my code is simply being
ignored and I don't know why.
That block of 3 lines is part of a loop which is executed several
times. Each time, the 3rd line "That's the puzzle" is mysteriously
missing.
(I am having great trouble using the dev c++ debugger so I'm making do
without it. And yes, I did use the dev c++ help manual for the
debugger.)
Thank you for your help.
Paul Epstein