精選文章
- 取得連結
- X
- 以電子郵件傳送
- 其他應用程式
標籤
Linux coding style
https://www.kernel.org/doc/html/v4.10/process/coding-style.html
http://iyu.is-programmer.com/posts/30315.html
- Tab - 8 格
- 一行 80 個字元. 如果你需要三級以上的縮進, 表示你的 code 有問題
- switch / case
- 函數
- do while
comment - C89
http://iyu.is-programmer.com/posts/30315.html
- Tab - 8 格
- 一行 80 個字元. 如果你需要三級以上的縮進, 表示你的 code 有問題
- switch / case
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| switch (suffix) {case 'G':case 'g': mem <<= 30; break;case 'M':case 'm': mem <<= 20; break;case 'K':case 'k': mem <<= 10; /* fall through */default: break;} |
1
2
3
4
| int function(int x){ body of function} |
do { body of do-loop} while (condition);- if
|
comment - C89
留言
張貼留言