docs: add coding style example

Add example of how to structure else-blocks following a multiline block.
This commit is contained in:
Anders Wenhaug 2021-06-23 23:39:56 +02:00 committed by Yu Watanabe
parent b905f3bbba
commit 4dbad977ff

View file

@ -69,6 +69,14 @@ layout: default
```
- Do not write `foo ()`, write `foo()`.
- `else` blocks should generally start on the same line as the closing `}`:
```c
if (foobar) {
find();
waldo();
} else
dont_find_waldo();
```
## Code Organization and Semantics