The following code supposedly worked in my school lab (in Turbo C++), but at home (in Dev C++) it doesn't seem to do that same. The program is for Binary search.
You are an absolute godsend. BTW, I am still in Highschool, and they don't teach us how to use Dev C++, insisting on using Turbo. They also haven't told us how to use a Debugger. Can you explain a bit to me, or point me towards any video or article that does?
turbo should have a debugger, though the last time I used it was in 1994, so maybe my memory is wrong. should be a menu drop down 'debug'.
what you do is compile your code in debug mode, and launch the debugger from your tool. Then you can step through the code, line by line, and observe variables as they are changed by the code. You see something go wrong and fix it, eg for loop suppose to go 10 times, and you step and it starts loop # 11, you found a problem.
old school, you can also debug by using print statements. find places in your code to inject a print that tells you what is happening there, and run it. You can use the pre-processor to turn these off and on, or comment/ uncomment them as you work the code. Remove or leave them when done is your choice (some are useful if problems come up later, some were only useful while you were fixing a specific problem that is now fixed so don't need anymore).