description | responses to exercises from K&R C (second edition) |
owner | copyleftie@protonmail.com |
last change | Fri, 23 Feb 2018 21:13:42 +0000 (23 16:13 -0500) |
URL | git://repo.or.cz/copyleftie-krc.git |
https://repo.or.cz/copyleftie-krc.git | |
push URL | ssh://repo.or.cz/copyleftie-krc.git |
https://repo.or.cz/copyleftie-krc.git (learn more) | |
bundle info | copyleftie-krc.git downloadable bundles |
content tags |
I'm working through the exercises in the second edition of K&R C (K&R2e). I'll be blogging my way through each chapter of the book as I complete it.
/copyleftie-krc
|- LICENSE
|- README.md
|- chXX/
|- |- exXX-XX.{c,md}
The responses are contained in folders ch01
, ch02
, and so on, and the
responses themselves are normally named
ex${chapter_number}-${exercise_number}.c
, with occasional exceptions for
written responses (*.md
), variants (ex*-${variant_name}.c
), or (rarely)
outright omissions (like exercise 1-1
).
Click tree
in the above links.
The code in this repository arbitrarily adopts OpenBSD's variant of Kernel Normal Form (KNF), even where that style explicitly contradicts K&R2e's recommendations. This is an exercise in "pick[ing] a style and stick[ing] with it", as recommended by the book itself.
C files in this repository begin with a tcc
shebang and are executable. tcc
compiles fast enough to make C usable as a
scripting language. I'm not sure I'd recommend using C for such a purpose, but
executable .c
s are very convenient for testing small programs like these ones.
I would appreciate bug reports if you notice mistakes or have any suggestions.
Deviations from OpenBSD's KNF should be considered bugs.
6 years ago | master | logtree |