I would really like to learn how to debug my programs. The book I'm using does not have much info on debugging and my instructor hasn't said much on the topic either. I ended up re-writing my source code because of seg fault error. The program works fine now, but I'm sure I would have saved a lot of time by debugging the program instead.
dontcare 0 Light Poster
Recommended Answers
Jump to PostAnother thing to do is to add 'assert( <expression> )' statements to your code. These can test expected conditions, such as the range of values for a parameter to a function:
#include <assert.h> void FetchRecord( int recordNumber ) { assert( recordNumber >= 0 ); // no negative …
All 3 Replies
Reply to this topic Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.