C++ Programming

C++ Programming


Spaces, Braces, and Parenthesis

Posted: 18 Apr 2013 07:55 AM PDT

For function and class definitions, it is unambiguous if you put the opening brace on the next line: void some_function(int param) { //function body } class SomeClass { //class body }; But for ifs, fors, whiles etc..., there are several possibilities for the braces and parenthesis: if(some_condition) { //... } if( some_condition ) { //... } if (


Post a Comment