Debugging Without a Debugger

If you have an Integrated Development Environment (IDE), you have a debugger—a special program that lets you see the program lines as they execute and examine values. It may even catch exceptions and take you to the exception line. But if you don't have a debugger, the strategies discussed in the following sections may help you find the cause of runtime errors.

Wolf Fencing

Imagine a farmer who has a wolf on his property, howling every night. To catch the wolf, the farmer builds an unclimbable fence around and across the middle of his property, and then listens for the howling. It will be on one side or the other of the fence. He then goes to that side of the fence and splits that half of the property with another ...

Get SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.