From the course: Debugging C Code

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Catching bugs

Catching bugs - C Tutorial

From the course: Debugging C Code

Start my 1-month free trial

Catching bugs

- Here is some C Code in the Vim editor, can you spot the error? Let me activate the C language syntax checking. (typing) Boom! Thanks to color coding, you see the pink text bleeding out from a missing double quote, right here. When I add it, (typing) the editor updates the text. Color coding is restored and the bug is caught. Had syntax checking been activated initially, the color coding would of instantly clued me in to the mistake. Modern source-code editors, such as the one used here in CodeBlocks, are excellent at matching items such as single and double quotes, parenthesis, braces, brackets, anything dealing with a pair of required items. (typing) The parenthesis is matched. (typing) The brace is matched. Not only that, the next line is indented and as I type, you see text hints. Press enter to autocomplete and the parenthesis are generated in pairs. Ditto for a double quote. Color coding in the…

Contents