Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
The C Programming Language
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Book by Brian Kernighan and Dennis Ritchie}} {{about|the textbook|the programming language covered in the book|C (programming language)}} {{Infobox book | name = The C Programming Language | image = The C Programming Language, First Edition Cover.svg | caption = Cover of the first edition. | author = [[Brian Kernighan]]<br>[[Dennis Ritchie]] | illustrator = | cover_artist = | language = English | subject = [[C programming language]] | genre = | publisher = [[Prentice Hall]] | pub_date = 1978 (1st Edition) <br> 1988 (2nd Edition) | isbn = 9780131101630 | dewey = | congress = | oclc = }} '''''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 today{{when|date=April 2025}}. 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.<ref name="ward198308" /><ref>{{Cite book|url=https://books.google.com/books?id=4Mfe4sAMFUYC|title=C in a Nutshell|last1=Prinz|first1=Peter|last2=Crawford|first2=Tony|date=2005-12-16|publisher=O'Reilly Media, Inc.|isbn=9780596550714|page=3|language=en}}</ref> == History == C was created by [[Dennis Ritchie]] at [[Bell Labs]] in the early 1970s as an augmented version of [[Ken Thompson]]'s [[B (programming language)|B]].<ref>{{cite web |url=https://www.bell-labs.com/usr/dmr/www/chist.html |last=Ritchie |first=Dennis M. |title=The Development of the C Language |date=1993 |work=History of Programming Languages, 2nd Edition |access-date=2018-11-11 }}</ref> Another Bell Labs employee, [[Brian Kernighan]], had written the first C tutorial,<ref>{{cite web |url=http://www.harmonyatwork.in/blog/2009/10/leap-in-and-try-things-brian-kernighan/ |title=Leap In and Try Things: Interview with Brian Kernighan |date=October 24, 2009 |work=Harmony at Work |access-date=2013-03-03 |url-status=dead |archive-url=https://web.archive.org/web/20120723182804/http://www.harmonyatwork.in/blog/2009/10/leap-in-and-try-things-brian-kernighan/ |archive-date=July 23, 2012}}</ref> and he persuaded Ritchie to coauthor a book on the language.<ref>{{cite web |url=https://www.youtube.com/watch?v=de2Hsvxaf8M |archive-url=https://ghostarchive.org/varchive/youtube/20211221/de2Hsvxaf8M |archive-date=2021-12-21 |url-status=live|title='C' Programming Language: Brian Kernighan - Computerphile |author=Computerphile |website=[[YouTube]] |date=2015-08-18 |access-date=2018-11-11 }}{{cbignore}}</ref> 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]].<ref name="k&r1e">{{cite book |last1= Kernighan |first1= Brian W. |author-link1= Brian Kernighan |last2= Ritchie |first2= Dennis M. |author-link2= Dennis Ritchie |title= The C Programming Language |edition= 1st |publisher= [[Prentice Hall]] |date= February 1978 |location= [[Englewood Cliffs, NJ]] |isbn= 0-13-110163-3 |url= https://archive.org/details/cprogramminglang00kern }}</ref> In April 1988, the second [[Edition (book)|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 [[C standard library|standard libraries]]. The second edition of the book (and {{as of|2024|lc=true}}, the most recent) has since been translated into over 20 languages.<ref>{{Cite web |url=https://www.cs.princeton.edu/~bwk/cbook.html |last=Keninghan |first=Brian W. |title=The C Programming Language, Second Edition |website=Priceton University |access-date=18 February 2023}}</ref> In 2012, an eBook version of the second edition was published in ePub, Mobi, and PDF formats.<ref>{{Cite interview |url=https://www.informit.com/articles/article.aspx?p=1960359 |title=An Interview with Brian Kernighan on C and The C Programming Language |website=InformIT |last=Keninghan |first=Brian W. |interviewer=John Wait |date=1 October 2012}}</ref> 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)|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!"<ref name="ward198308">{{cite news |last=Ward |first=Terry A. |url=https://archive.org/stream/byte-magazine-1983-08/1983_08_BYTE_08-08_The_C_Language#page/n267/mode/2up |title=Annotated C / A Bibliography of the C Language |work=Byte |date=August 1983 |access-date=31 January 2015 |pages=268}}</ref> [[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."<ref name="pournelle198312">{{cite news |last=Pournelle |first=Jerry |author-link=Jerry Pournelle |url=https://archive.org/stream/byte-magazine-1983-12/1983_12_BYTE_08-12_Easy_Software#page/n519/mode/2up |title=The User Looks at Books |work=Byte |date=December 1983 |access-date=24 July 2016 |pages=519}}</ref> == 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, {{blockquote|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.|preface to the second edition<ref name="k&r2e">{{cite book |last1= Kernighan |first1= Brian |author-link1= Brian Kernighan |last2= Ritchie |first2= Dennis M. |author-link2= Dennis Ritchie |title= The C Programming Language |edition= 2nd |publisher= [[Prentice Hall]] |date= March 1988 |location= [[Englewood Cliffs, NJ]] |url= https://archive.org/details/cprogramminglang00bria |isbn= 0-13-110362-8 }}</ref>}} [[File:Hello World Brian Kernighan 1974.jpg|thumb|"Hello, World!" program by Brian Kernighan (1978)]] 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, {{blockquote|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.|preface to the second edition<ref name="k&r2e" />}} 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 "[[Indent style#K&R|K&R style]]" or the "One True Brace Style"{{Ambiguous|reason=K&R and OTB aren't the same thing|date=February 2025}} and became the coding style used by convention in the source code for the [[Unix]] and [[Linux]] [[kernel (operating system)|kernels]]. ==See also== * ''[[The C++ Programming Language]]'' * ''[[The Preparation of Programs for an Electronic Digital Computer]]'' == References == {{Reflist}} == External links == * [https://ia903407.us.archive.org/35/items/the-ansi-c-programming-language-by-brian-w.-kernighan-dennis-m.-ritchie.org/The%20ANSI%20C%20Programming%20Language%20by%20Brian%20W.%20Kernighan%2C%20Dennis%20M.%20Ritchie.pdf The C Programming Language], second edition ([https://archive.org/details/the-ansi-c-programming-language-by-brian-w.-kernighan-dennis-m.-ritchie.org/page/8/mode/2up item information] at the Internet Archive) * [http://s3-us-west-2.amazonaws.com/belllabs-microsite-dritchie/cbook/index.html The C Programming Language] - Dennis Ritchie's page containing information regarding translations, errata, etc. * [https://www.cs.princeton.edu/~bwk/cbook.html The C Programming Language] - Brian Kernighan's page (containing mostly the same, slightly more up-to-date information) * [https://clc-wiki.net/wiki/K%26R2_solutions Answers to The C Programming Language Exercises] {{s-start}} {{s-ttl |title=[[C (programming language)|C language]] standards}} {{s-aft |after= {{nobr|[[C89 (C version)|C89 / C90 / "ANSI C"]]}}<br />(2nd edition of book)}} {{s-end}} {{DEFAULTSORT:C Programming Language}} [[Category:1978 non-fiction books|C Programming Language, The]] [[Category:Computer programming books|C Programming Language, The]] [[Category:C (programming language)|C Programming Language, The]] [[Category:Collaborative non-fiction books]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:About
(
edit
)
Template:Ambiguous
(
edit
)
Template:As of
(
edit
)
Template:Blockquote
(
edit
)
Template:Cbignore
(
edit
)
Template:Cite book
(
edit
)
Template:Cite interview
(
edit
)
Template:Cite news
(
edit
)
Template:Cite web
(
edit
)
Template:Infobox book
(
edit
)
Template:Reflist
(
edit
)
Template:S-aft
(
edit
)
Template:S-end
(
edit
)
Template:S-start
(
edit
)
Template:S-ttl
(
edit
)
Template:Short description
(
edit
)
Template:When
(
edit
)