The C Programming Language (book)

Book cover of The C Programming Language, first edition
Book cover of The C Programming Language, second edition

The C Programming Language (sometimes referred to as K&R, after its authors' initials) is a well-known computer programming book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the 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 the C programming language and is still widely read and used today. 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.


The first edition of the book, published in 1978, was the first widely available book on the C programming language. C was created by Dennis Ritchie. Brian Kernighan wrote the first C tutorial.[1] The authors came together to write the book in conjunction with the language's early development at AT&T Bell Labs. The version of C described in this book is sometimes referred to as K&R C (after the book's authors), often to distinguish this early version from the later version of C standardized as ANSI C.[2]

In 1988, the second edition of the book was published, updated to cover the changes to the C programming language resulting from the new ANSI C standard, particularly with the inclusion of reference material on standard libraries. The second edition (and as of 2014, the most recent edition) of the book 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.

ANSI C, first standardized in 1988, has since undergone several revisions, the most recent of which is ISO/IEC 9899:2011 (also known as "C11"), adopted as an ANSI standard in October 2011. However, no new edition of The C Programming Language has yet been issued to cover the more recent standards.


The C Programming Language has often been cited as a model for technical writing, due to the book's clear presentation and concise treatment. In just 228 pages (272 pages in the second edition), the book covers C comprehensively. Examples generally consist of complete programs of the type one is likely to encounter in daily usage of the language, with an emphasis on system programming. The technical details of C are balanced by the authors' observations on good programming practice, which are immediately illustrated with concrete, realistic examples.

Perhaps the most famous example program from the book is its "hello, world" program, which just prints out the text "hello, world" to the terminal, as an illustration of a minimal working C program. Numerous texts since then 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 geared the second edition toward programmers rather than compiler writers; in the authors' own words:

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" or the "One True Brace Style" and, significantly, became the coding style used by convention in the source code for the Unix and Linux kernels.

See also


  1. ^ "Leap In and Try Things: Interview with Brian Kernighan". Harmony at Work. October 24, 2009. Retrieved 2013-03-03. 
  2. ^ Kernighan, Brian W.; Dennis M. Ritchie (February 1978). The C Programming Language (1st ed.). Englewood Cliffs, NJ: Prentice Hall. ISBN . 
  3. ^ a b Kernighan; Dennis Ritchie (March 1988). The C Programming Language (2nd ed.). Englewood Cliffs, NJ: Prentice Hall. ISBN . 

External links

  • The C Programming Language Book Home Page at Bell Labs
  • Answers to The C Programming Language Exercises
First C language standards Succeeded by
C89 / C90 / "ANSI C"
(2nd edition of book)
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.