Would anyone like to share their tips & tricks for debugging functions & whole programs in C++.
I find I suck at debugging :P & really dont look forward to having to go through my functions again to see if there are any loopholes etc so if anyone could provide some tips & tricks it would be really helpful.
I have searched alot and there aren't many places to find advice on how to do it & I find it really tedius :P
From my experience I would offer this advice:
- DEBUG AS YOU GO - Every time you write a function or every hour or sumthing like that. Going over your whole program is a b***h, lol, :P
- When debugging functions that take in input - list all the possible input that someone may enter then test ur function with it, make sure it either works or it outputs "invalid input" or etc, so that it doesn't crash.
Please share any other advice for debugging :)