-
Notifications
You must be signed in to change notification settings - Fork 30
/
CODING.RULES.txt
59 lines (49 loc) · 1.15 KB
/
CODING.RULES.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* CODING RULES */
//single line comment
/* #####
* multi
* line
* comment
*/
#include <stdio.h>
/* use tab == (4 spaces)
* or 2tab == (8 spaces)
* for increment
* and each level
*/
//remove spaces at the end of lines
//one empty line between functions
const char *idea_options(void){
<------>if (sizeof(short) != sizeof(IDEA_INT)) // please do not use shortenings
<------>{
<------><-->return ("idea(int)");
<------>} else {
<------><-->return ("idea(short)");
<------>}
}
//alternative usual notation
<------>if (sizeof(short) != sizeof(IDEA_INT)) { // please do not use shortenings
<------><-->return ("idea(int)");
<------>} else {
<------><-->return ("idea(short)");
<------>}
}
/* ##########################
* each function or procedure
* begins & ends with a brace
*/
int main(void)
{
<------>printf("hello, world\n");
<------>for (count=1; count < 11; count = count + 1)
<------>{
<------><-->printf(" %d\n", count);
<------>}
<------>//one empty line between codeblocks
<------>while(i < x)
<------>{
<------><-->printf(" %d\n", i);
<------><-->i++;
<------>}
<------>exit(0);
}