You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Non-portable features shall be clearly separated from portable ones in either:
6
+
7
+
- ifdef macro blocks
8
+
- separate files
9
+
- separate directories
10
+
- separate repositories
11
+
12
+
This includes features which were not present in the first standardized version of languages. E.g., C99 features must be put inside `#ifdf __STDC_VERSION__` blocks.
13
+
14
+
Everything that can be checked in an assertion will be checked, and will not get printed.
15
+
16
+
For example, a C addition operator `+` test should be done as:
17
+
18
+
assert(1 + 1 == 2);
19
+
20
+
and *never*:
21
+
22
+
printf("%d\n", 1 + 1);
23
+
24
+
so that all can be verified automatically.
25
+
26
+
Features which yield unpredictable outputs can print results to stdout. For example, `time(NULL)`
27
+
28
+
printf("%d\n", 1 + 1);
29
+
30
+
Features that:
31
+
32
+
- require user input such as C `scanf`
33
+
- make programs wait for perceptible amounts of time
34
+
35
+
shall be put inside a block analogous to a `if (0){ ... }` to be turned on only when users want to test those specific features.
36
+
37
+
Cheat source comments are written in markdown *indented by headers* and commented out.
38
+
39
+
Every important keyword that one might search for in the feature has a hash before it, e.g. `#function`, `#include`, `#printf`, etc.
Copy file name to clipboardExpand all lines: README.md
+32-110
Original file line number
Diff line number
Diff line change
@@ -6,113 +6,35 @@ C and C++ information, cheatsheets and mini-projects.
6
6
7
7
Relies on <https://github.com/cirosantilli/cpp-boilerplate> to factor code out. See [its documentation](https://github.com/cirosantilli/cpp-boilerplate/blob/master/README.md) for information on how to use this project.
8
8
9
-
## Most useful files
10
-
11
-
-[c.c](c.c): C cheatsheet
12
-
-[cpp.cpp](main_cpp.cpp): C++ cheatsheet
13
-
-[POSIX](posix/): POSIX C API
14
-
-[Multi-file](multifile/): `include`, `extern` vs `static`, dynamic libraries, cross language calls
15
-
-[GCC](gcc/): GCC extensions
16
-
-[OpenGL](opengl/)
17
-
-[KDE](kde/)
18
-
19
-
Other files:
20
-
21
-
-[Boost](boost/)
22
-
-[Flex and Bison](flex-bison/)
23
-
-[GDB](gdb.md)
24
-
-[glibc](glibc/)
25
-
-[Implementations](implementations.md)
26
-
-[Style guides](style-guides.md)
27
-
-[CMake](cmake.md)
28
-
-[hello_world.c](hello_world.c)
29
-
-[hello_world_cpp.cpp](hello_world_cpp.cpp)
30
-
31
-
GUI:
32
-
33
-
-[GTK](gtk/)
34
-
-[Qt](qt/)
35
-
-[X11](x11)
36
-
-[Open GL](opengl/)
37
-
38
-
Scientific:
39
-
40
-
-[Fortran](fortran/)
41
-
-[GSL](gsl/)
42
-
-[LAPACK](lapack/)
43
-
-[OpenCV](opencv/)
44
-
-[PLplot](plplot/)
45
-
46
-
## Dependencies
47
-
48
-
Most builds require:
49
-
50
-
-`make` (POSIX)
51
-
-`gcc` >= 4.7
52
-
-`g++` >= 4.7
53
-
54
-
Even though we use GNU tools by default, great attention is paid to portability of portable subjects like ANSI C, which should compile in any compiler.
55
-
56
-
In addition, each directory may have their own extra dependencies as stated in their README.
57
-
58
-
You can install dependencies on latest LTS Ubuntus with:
59
-
60
-
./configure
61
-
62
-
Other system install are not going to be supported as that would lead to too much maintenance overhead. If you don't have Ubuntu, consider using our [Vagrantfile](Vagrantfile).
63
-
64
-
## Usage
65
-
66
-
When there are multiple files compiled, e.g.:
67
-
68
-
c.c -> c
69
-
cpp.cpp -> cpp
70
-
71
-
run a given file by specifying the basename without extension:
72
-
73
-
make run=c
74
-
make run=cpp
75
-
76
-
The `=` sign is *not* optional!
77
-
78
-
Doing just `make run` in those cases will run the default file: `main`.
79
-
80
-
## Style
81
-
82
-
Non-portable features shall be clearly separated from portable ones in either:
83
-
84
-
- ifdef macro blocks
85
-
- separate files
86
-
- separate directories
87
-
- separate repositories
88
-
89
-
This includes features which were not present in the first standardized version of languages. E.g., C99 features must be put inside `#ifdf __STDC_VERSION__` blocks.
90
-
91
-
Everything that can be checked in an assertion will be checked, and will not get printed.
92
-
93
-
For example, a C addition operator `+` test should be done as:
94
-
95
-
assert(1 + 1 == 2);
96
-
97
-
and *never*:
98
-
99
-
printf("%d\n", 1 + 1);
100
-
101
-
so that all can be verified automatically.
102
-
103
-
Features which yield unpredictable outputs can print results to stdout. For example, `time(NULL)`
104
-
105
-
printf("%d\n", 1 + 1);
106
-
107
-
Features that:
108
-
109
-
- require user input such as C `scanf`
110
-
- make programs wait for perceptible amounts of time
111
-
112
-
shall be put inside a block analogous to a `if (0){ ... }` to be turned on only when users want to test those specific features.
113
-
114
-
Cheat source comments are written in markdown *indented by headers* and commented out.
115
-
116
-
Every important keyword that one might search for in the feature has a hash before it, e.g. `#function`, `#include`, `#printf`, etc.
117
-
118
-
##
9
+
1.[Getting started](getting-started.md)
10
+
1. Best content
11
+
1.[c.c](c.c): C cheatsheet
12
+
1.[cpp.cpp](main_cpp.cpp): C++ cheatsheet
13
+
1.[POSIX](posix/): POSIX C API
14
+
1.[Multi-file](multifile/): `include`, `extern` vs `static`, dynamic libraries, cross language calls
0 commit comments