This is the classic introduction to the C programming language. The first edition was originally published in 1978 and this second edition was published in 1988. A lot of things have changed since then but this is a worthwhile introduction nevertheless. There are other books on C but I am not sure which books to read after this one – if I could have a modern bibliography for this book, it would come in very handy – I intend to review other C books, in time.
After an introductory chapter, the basics of the language are catered for in this order:
- Types, operators, and expressions
- Control flow
- Functions and program structure
- Pointers and arrays
- Input and output
After that, there is a chapter on ‘The UNIX System Interface’, which features interesting albeit limited implementations of fopen, getchar, putchar, opendir and malloc.
The appendices round off the book. The Reference Manual is based on the draft ANSI standard and presents a grammar of the language. The Standard Library appendix complements the grammar by offering up a summary of the standard library. The final appendix summarises the changes made to the language since the publication of the first edition of this book.
The source code for this book is available to download but I found the organisation of the code to be lacking. Fortunately, a kind soul has reorganised the code and made it available on GitHub (https://github.com/caisah/K-and-Rexercises-and-examples). Most Internet searches for this book bring up sites that either want to sell you the book or give you a pirate PDF copy. Because of that, I’m citing an errata page (https://s3-us-west-2.amazonaws.com/belllabs-microsite-dritchie/cbook/2ediffs.html)
The code examples are for tuition purposes only – this isn’t the place to go looking for production code – however the UNIX System Interface chapter comes close.
Finally, the book ends with an index – a glossary would have been welcome, too. This book does show its age a bit but it still should be on the reading list of any would-be C programmer.