Hi,
I'm using Code::Blocks 20.03 on a Win 7 Pro box. I'm using Brian Overland's C++ Without Fear 3rd Ed.
I copied one of his examples into Code::Blocks and tried to run it. It did not produce the intended results. So I rechecked that I had copied the code correctly, and I had.
I then decided to run the code one line at a time and set up watches on some of the variables to see if I could detect a problem. The code has two functions. One that has a couple of for loops and the other that swaps two variables.
When stepping thru the main code, it enters the first function when it's invoked. The second function is called from the first function, the function executes when called, but does not indicate that it went thru it step-wise. And therefore the variables in that function never show up in the watch list. They just say: Not available in current context.
I'm at a loss to understand what's going on here.
There was an error in the printed code on the page of the book where a variable was declared with the name of "lowest". But in the code "lowest" was never used, however "low" was. It produced a compile error. So I changed "lowest" to "low" in the declaration and the code compiled.
Thanks,
Vic