(Post Under Construction)
Kernighan and Ritchie "The C Programming Language" Second Edition is an classic interpretation of the C language in the same way as Strunk and White "Elements of Style" is a classic interpretation of the English language or Wolfgang Pauli's lecture on "Wave Mechanics" is a classic representation of the math of physics. This does not mean that all of the programming in K&R C is useful today or even the best representation of the use of C (1, 2). A paraphrased statement of Pauli's famous belief about untestable physics applies to engineering software as well: If your code can't be proven wrong by someone, you have probably not produced anything of much value.
Software engineering languages have variability, flexibility and polymorphism by design There are always multiple solutions to any given problem. Without honoring this fundamental nature of exploratory science; the power and endurance of any one language is limited. There are a number of K&R solution sets provided on the web. Below is a selection of solutions to the Fahrenheit-Celsius converter code discussed in Chapter 1 of "
The C Programming Language" as provided by
Richard Heathfield. A
C language reference is available from the
GNU Project. It is particularly important to read the
while and
do statement sections. A number of third party GNU C tutorials are also available. Use the google search term: 'filetype:PDF gnu c programming tutorial'.
Learning GNU C is one such.
This post is primarily about understanding the
logic and
control structures of C. The implementation of C library functions (e.g.
printf) are left for another discussion. -RMF