C programming language/K and R C

< C programming language

HomePage | Recent changes | View source | Discuss this page | Page history | Log in |

Printable version | Disclaimers | Privacy policy

K&R C stands for Kernighan and Ritchie C. Brian Kernighan and Dennis Ritchie were the authors of the White Book (The C Programming Language, popularly known as K&R) that described the programming language C. Although the language was standartized as an ANSI standard, and the book's second edition was updated to fit it, K&R C is always used to refer to the language as it is described in the first edition of the book.

This version is frequently regarded as an unofficial standard for the most basic features of a C compiler. Since not all of the currently-used compilers were updated to support ANSI C fully (or have certain bugs that contradict ANSI), K&R C is often seen as the lowest common denominator that should be stuck to if maximal portability is desired. Thus, for example, the bootstrap of the the GCC compiler (xgcc) had been written in K&R C, since many of the platforms which din't have an ANSI C compiler at the time of GCC's writing did have an older K&R one, or their existing ANSI support was incomplete. By 2001, however, this is more an historical fact rather than the current situation, since ANSI C is now supported by almost all the widely used compilers.

K&R C programs, if reasonably well written, are legal in ANSI C, and will normally have the same effect in the two dialects. This was one of aims of the ANSI C standard process, although they added more new features than is normal in programming language standardization.

See Evolution of C

This article (or an earlier version of it) contains material from FOLDOC, used with permission.