Skip to content

Commit

Permalink
Curly braces for single line statements
Browse files Browse the repository at this point in the history
  • Loading branch information
azonenberg committed Jun 3, 2020
1 parent cf42448 commit a20bf1d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cpp-coding-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ limited to `gets()`, `strcpy()`, `sprintf()`, etc.

* One level of indentation = one \t character = four columns. Do not use spaces for indentation.
* Curly braces go on their own line.
* Curly braces are not required for a control statement with a single-line body, however if an explicitly empty body is
used then use braces rather than simply a semicolon. The opening and closing braces may be on the same line.
* The * in a pointer declaration is part of the type, not the variable. For example `int* foo`, not `int *foo`.
* Do not put a space between a keyword or identifier name and an opening parentheses. For example `if(foo)`, not `if
(foo)`.
Expand Down

0 comments on commit a20bf1d

Please sign in to comment.