Mistakes the compiler doesn't catch (the hardest problems to solve sometimes)
GNU C++ Compiler
Debugging: Run-time Errors
cin/cout outputs wrong number of items or just
completely skips some
- Check that you have arrows, not commas, between every 2
items (variables, strings, function calls, etc., all count as
- Loop or decision statement doesn't work
- Check for semicolons at the end of a loop or decisiont statement.
They don't belong there (
if, do, while, for, etc.
do not take a semicolon at the end of the line)!
switch/case statement 'bleeds' from one case to
- There must be a
break; at the end of every
- Wrong answer to a seemingly correct formula
- Remember operator precedence! Start by adding lots of
parentheses--it can't hurt to have a lot of them! This
is especially important in complex formulas where the
precedence may be obvious to you, but not to the
Mail me your suggestions!
Back to Debugging Page
Back to GNU C++ Compiler Home Page
Back to my Home Page
Andrews University's Home Page