Monthly Archive: February 2012

Write if statements with braces 0

Tip of the week#6: Write if statements with braces

By putting braces around every block of code you write, you ensure that future edits won’t introduce bizarre bugs. If you have a one-line if statement: if(condition) execute(); you should still surround execute(); with braces as follows: if(condition) { execute(); } Now, if you want to go back to the code in future and add a second instruction if(condition) { execute(); execute2(); } you don’t have to worry about putting in the braces.

FREE C Cheatsheet - Speed Up Your C Programming.

FREE C Cheatsheet - Speed Up Your C Programming.

Download a 7-page free cheat sheet for easy and quick access to C Concepts, Snippets, and Syntax.

Thank you! Check you inbox and access your cheat-sheet