An open API service indexing awesome lists of open source software.

https://github.com/amarok24/c_snippets

My snippets in C language, ISO C90/C99.
https://github.com/amarok24/c_snippets

c c90 c99

Last synced: about 1 year ago
JSON representation

My snippets in C language, ISO C90/C99.

Awesome Lists containing this project

README

          

# c_snippets
My C snippet collection. Most of it is old-school code (C89/C90, C99), so it should be fairly well portable to most systems, even old computers.

## Compilation of source code with GCC

If you run into troubles when compiling, you might want to tell the GNU C Compiler (GCC) what C standard to use for compilation; here is a very basic example:

```sh
gcc -std=c99 somefile.c -o outputexecutable
```

If the math library is used (if you see `#include ` somewhere on top of the C source), you have to explicitly tell GCC to link the math library (this has historical reasons which I don't understand). Simply put `-lm` (link math) at the end of the compile line:

```sh
gcc -std=c99 somefile.c -o outputexecutable -lm
```

To reduce file size of the executable use the `-s` flag (remove all symbol table information).