1

I am reading the classic book on C - The C Programming Language Book by Brian Kernighan and Dennis Ritchie. The preface of the book says

All examples have been tested directly from the text, which is in machine-readable form.

What does this mean?

1 Answer 1

4

(just a guess)

Probably that every code example has been indeed tested on a system with a C compiler, and pretty-printed in the book (perhaps using troff or whatever document formatter was used by K&R) by some automatic tool (I don't know what tool was used by K&R. Today, you'll use e.g. vgrind or pygments or LaTeX's listings package, or some other pretty-printer). So there cannot be typos while converting C code to paper (e.g. as if the C code has been manually copied and typeset)

1
  • 1
    Yes — there are many examples of books containing code listings that are riddled with errors, especially older books that weren't typeset digitally, or were converted through some semi-manual process. K&R is letting the reader know that it isn't one of those. Commented Jul 4, 2016 at 9:03

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.