この項目では、技術書について説明しています。プログラミング言語そのものについては「C言語」をご覧ください。
プログラミング言語C
The C Programming Language
原書・第1版
著者Brian W. Kernighan、Dennis M. Ritchie
訳者石田晴久
発行日 1978年2月、1988年3月 (2nd ed.)
1981年7月、1989年6月15日(第2版)、1994年3月(第2版訳書訂正版)
発行元 Prentice Hall
[ ウィキデータ項目を編集 ]
テンプレートを表示
『プログラミング言語C』(原題:The C Programming Language)は、ブライアン・カーニハン (Brian W. Kernighan) とデニス・リッチー (Dennis M. Ritchie) によって書かれたC言語についての書籍である。著者名の頭文字からしばしばK&Rと略される。
初版[1]は1978年に出版され、C言語が標準化されるまでの間リファレンス的な扱いを受けていた。1988年の第2版[2]ではANSIでの標準化 (C89) を反映して大幅に変更されている。
日本語訳は初版・第2版と訳書訂正版とも石田晴久[3][4][5]。C Magazine創刊号の石田のインタビューによると、初版は某企業がC言語講座事業を行うにあたり、許可を取らずに勝手に翻訳していたものを貰い受けそれを下訳として翻訳を行なったという。
1.1 Getting Started に、例として掲載されている"hello, world"プログラムは、あらゆる「プログラミングの最初の例題」として定番となった。 1989年のANSI標準化以前のC言語に見られた、関数の引数名と型について分けて示す以下のような形式について、K&Rスタイルと呼ぶことがある(この用法では本書の初版を指し、標準化以前の、という意味で使われている)。 int foo(a, b); int foo(a, b) int a, b; { ... このようなコードは、現在ではほとんど見られない。また関数の宣言に引数の型の情報が無いため、型によるバグが検出できなくなる原因になるので、使うべきでない。 本書でソースコード片を示すのに使っているインデントやブレースの位置などのスタイルを指して、K&Rスタイルと呼ぶことがある。紙面の都合などもあって整形されているので、特にこれを選ぶべきといった理由があるわけでもない。本文中には、どのようなスタイルで書いてもかまわないが一貫しているべきである、とある。
K&Rスタイル
関数宣言と関数定義
コーディングスタイル「字下げスタイル#K&Rのスタイル」も参照
脚注[脚注の使い方]^ Brian W. Kernighan, Dennis M. Ritchie (February 1978) (english). The C Programming Language (1st ed.). Englewood Cliffs, NJ: Prentice Hall. .mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation.cs-ja1 q,.mw-parser-output .citation.cs-ja2 q{quotes:"「""」""『""』"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free a,.mw-parser-output .citation .cs1-lock-free a{background:url("//upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited a,.mw-parser-output .id-lock-registration a,.mw-parser-output .citation .cs1-lock-limited a,.mw-parser-output .citation .cs1-lock-registration a{background:url("//upload.wikimedia.org/wikipedia/commons/d/d6/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription a,.mw-parser-output .citation .cs1-lock-subscription a{background:url("//upload.wikimedia.org/wikipedia/commons/a/aa/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("//upload.wikimedia.org/wikipedia/commons/4/4c/Wikisource-logo.svg")right 0.1em center/12px no-repeat}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:#d33}.mw-parser-output .cs1-visible-error{color:#d33}.mw-parser-output .cs1-maint{display:none;color:#3a3;margin-left:0.3em}.mw-parser-output .cs1-format{font-size:95%}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}ISBN 0-13-110163-3
^ Brian W. Kernighan, Dennis M. Ritchie (March 1988) (english). The C Programming Language
^ ブライアン・カーニハン、デニス・リッチー共著 著、石田晴久 訳『プログラミング言語C -- UNIX流プログラム書法と作法』(A5判)(初版)共立出版、1981年7月(原著1978年2月)。ISBN 978-4320021457。
^ ブライアン・カーニハン、デニス・リッチー共著 著、石田晴久 訳『プログラミング言語C -- ANSI規格準拠』(A5判)(第2版)共立出版、1989年6月15日(原著1988年3月)。ISBN 978-4320024830。
^ ブライアン・カーニハン、デニス・リッチー共著 著、石田晴久 訳『プログラミング言語C -- ANSI規格準拠』(A5判)(第2版(訳書訂正版))共立出版、1994年3月(原著1988年3月)。ISBN 978-4320026926。
表
話
編
歴
C言語
K&R
ANSI C
C89
C90
C99
C11
C17(英語版)
C2x(英語版)
Embedded C(英語版)
MISRA C
Cの機能
関数
ヘッダファイル
演算子
文字列(英語版)
文法(英語版)
プリプロセッサ(英語版)
データ型(英語版)
キーワード
フリースタンディング環境
標準Cライブラリの関数
ctype.h(英語版)
stdio.h
math.h(英語版)
stdlib.h(英語版)
string.h(英語版)
time.h
stdarg.h(英語版)
POSIXライブラリ(英語版)
標準Cライブラリ
Bionic(英語版)
libhybris(英語版)
dietlibc
EGLIBC
glibc
klibc(英語版)
マイクロソフトランタイムライブラリ(英語版)
musl
Newlib
uClibc
BSD libc
コンパイラ
ACK(英語版)
BDS-C
Clang