ArticleslgStudy

computer science

The C Programming Language

The C Programming Language is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand The C Programming Language rather than just read about it. In short: The C Programming Language (sometimes termed K&R, after its authors' initials) is a computer programming book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the C programming language, as well as co-designed the Unix operating system with which development of the language was closely intertwined. The book was central to the development and popularization of C an…

The C Programming Language — main illustration
The C Programming Language — illustration

Key takeaways

  • The C Programming Language belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect The C Programming Language to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of The C Programming Language from memory before moving on to harder problems.

Reference excerpt

The C Programming Language (sometimes termed K&R, after its authors' initials) is a computer programming book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the C programming language, as well as co-designed the Unix operating system with which development of the language was closely intertwined. The book was central to the development and popularization of C and is still widely read and used. Because the book was co-authored by the original language designer, and because the first edition of the book served for many years as the de facto standard for the language, the book was regarded by many to be the authoritative reference on C.

History C was created by Dennis Ritchie at Bell Labs in the early 1970s as an augmented version of Ken Thompson's B. Another Bell Labs employee, Brian Kernighan, had written the first C tutorial, and he persuaded Ritchie to coauthor a book on the language. Kernighan would write most of the book's "expository" material, and Ritchie's reference manual became its appendices. The first edition, published February 22, 1978, was the first widely available book on the C programming language. Its version of C is sometimes termed K&R C (after the book's authors), often to distinguish this early version from the later version of C standardized as ANSI C. In April 1988, the second edition of the book was published, updated to cover the changes to the language resulting from the then-new ANSI C standard, particularly with the inclusion of reference material on standard libraries. The second edition of the book (and as of 2024, the most recent) has since been translated into over 20 languages. In 2012, an eBook version of the second edition was published in ePub, Mobi, and PDF formats. C was first standardized in 1989 (as ANSI X3.159-1989) and has since undergone several revisions. However, no new edition of The C Programming Language has been issued to cover the more recent standards.

Reception Byte magazine stated in August 1983, "[The C Programming Language] is the definitive work on the C language. Don't read any further until you have this book!" Jerry Pournelle wrote in the magazine that year that the book "is still the standard ... a bit terse". He continued, "You can learn the C language without getting Kernighan and Ritchie, but that's doing it the hard way. You're also working too hard if you make it the only book on C that you buy."

Influence The C Programming Language has often been cited as a model for technical writing, with reviewers describing it as having clear presentation and concise treatment. Examples generally consist of complete programs of the type one is likely to encounter in daily use of the language, with an emphasis on system programming. Its authors wrote,

We have tried to retain the brevity of the first edition. C is not a big language, and it is not well served by a big book. We have improved the exposition of critical features, such as pointers, that are central to C programming. We have refined the original examples, and have added new examples in several chapters. For instance, the treatment of complicated declarations is augmented by programs that convert declarations into words and vice versa. As before, all examples have been tested directly from the text, which is in machine-readable form.

The book introduced the "Hello, World!" program, which prints only the text "hello, world" as an illustration of a minimal working C program. Since then, many texts have followed that convention for introducing a programming language. Before the advent of ANSI C, the first edition of the text served as the de facto standard of the language for writers of C compilers. With the standardization of ANSI C, the authors more consciously wrote the second edition for programmers rather than compiler writers, writing,

Appendix A, the reference manual, is not the standard, but our attempt to convey the essentials of the standard in a smaller space. It is meant for easy comprehension by programmers, but not as a definition for compiler writers—that role properly belongs to the standard itself. Appendix B is a summary of the facilities of the standard library. It too is meant for reference by programmers, not implementers. Appendix C is a concise summary of the changes from the original version. The influence of The C Programming Language on programmers, a generation of whom first worked with C in universities and industry, has led many to accept the authors' programming style and conventions as recommended practice, if not normative practice. For example, the coding and formatting style of the programs presented in both editions of the book is often referred to as "K&R style" and became the coding style used by convention in the source code for the Unix and Linux kernels.

See also The C++ Programming Language The Preparation of Programs for an Electronic Digital Computer List of computer science journals List of software programming journals List of computer magazines List of computer books

References

External links The C Programming Language, second edition (item information at the Internet Archive) The C Programming Language - Dennis Ritchie's page containing information regarding translations, errata, etc. The C Programming Language - Brian Kernighan's page (containing mostly the same, slightly more up-to-date information) Answers to The C Programming Language Exercises

Illustrations

The C Programming Language illustration
The C Programming Language illustration
The C Programming Language: "Hello, World!" program by Brian Kernighan (1978)
"Hello, World!" program by Brian Kernighan (1978)

Worked examples

Example 1 — a first encounter with The C Programming Language

Start with the simplest possible case. Write down what The C Programming Language claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to The C Programming Language before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about The C Programming Language ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of The C Programming Language

In research
The C Programming Language appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses The C Programming Language in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
The C Programming Language is common in secondary-school and first-year university syllabi. It links to neighbouring topics 1978 non-fiction books, C (programming language), C (programming language) libraries, so understanding it makes those chapters shorter.
In everyday life
Look for The C Programming Language outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study The C Programming Language in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what The C Programming Language means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain The C Programming Language out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is The C Programming Language in simple terms?

The C Programming Language (sometimes termed K&R, after its authors' initials) is a computer programming book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the C programming language, as well as co-designed the Unix operating system with which…

Why does The C Programming Language matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study The C Programming Language?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on The C Programming Language.

Tags

  • 1978 non-fiction books
  • C (programming language)
  • C (programming language) libraries
  • Collaborative non-fiction books
  • Computer programming books
  • Free software programmed in C
  • Lists of software
  • Mathematical libraries
  • Programming languages
  • Software by programming language
  • Software programmed in C

Keep exploring