-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindent.cpp
More file actions
35 lines (29 loc) · 728 Bytes
/
Copy pathindent.cpp
File metadata and controls
35 lines (29 loc) · 728 Bytes
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
// indent *.h
// indent *.cpp
// uses .indent.pro
// indentation style by example
int main ()
{
// opening brace { for functions on separate line
for( int i = 0; i < 10; ++i ) {
cout << i << endl;
}
// for( like a function, blank after parenthesis (
// lots of whitespace,
// ++i is faster than i++,
// opening brace { on same line as for
// indentation is 2
// closing brace } on separate line
bool flag = true; // whitespace
if( flag ) {
cout << "true" << endl;
}
else {
cout << "FALSe" << endl;
}
// if( like a function, blank after parenthesis (
// opening brace { on same line as if
// indentation is 2
// closing brace } on separate line
// else { on seprate line
}