Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the major differences between ANSI C and K&R C?

Tags:

c

c89

kr-c

The Wikipedia article on ANSI C says:

One of the aims of the ANSI C standardization process was to produce a superset of K&R C (the first published standard), incorporating many of the unofficial features subsequently introduced. However, the standards committee also included several new features, such as function prototypes (borrowed from the C++ programming language), and a more capable preprocessor. The syntax for parameter declarations was also changed to reflect the C++ style.

That makes me think that there are differences. However, I didn't see a comparison between K&R C and ANSI C. Is there such a document? If not, what are the major differences?

EDIT: I believe the K&R book says "ANSI C" on the cover. At least I believe the version that I have at home does. So perhaps there isn't a difference anymore?

like image 471
Thomas Owens Avatar asked Aug 22 '08 14:08

Thomas Owens


People also ask

What is the difference between C and ANSI C?

ANSI C merely refers to a particular standard for the C Programming Language - i.e. there is no difference, they refer to the same thing.

What is the meaning of ANSI C?

ANSI C, ISO C, and Standard C are successive standards for the C programming language published by the American National Standards Institute (ANSI) and ISO/IEC JTC 1/SC 22/WG 14 of the International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC).

What is KR notation in C?

Answer: Option C. Explanation: KR Notation means Kernighan and Ritche Notation. Workspace.


1 Answers

There may be some confusion here about what "K&R C" is. The term refers to the language as documented in the first edition of "The C Programming Language." Roughly speaking: the input language of the Bell Labs C compiler circa 1978.

Kernighan and Ritchie were involved in the ANSI standardization process. The "ANSI C" dialect superceded "K&R C" and subsequent editions of "The C Programming Language" adopt the ANSI conventions. "K&R C" is a "dead language," except to the extent that some compilers still accept legacy code.

like image 163
Chris Conway Avatar answered Sep 16 '22 14:09

Chris Conway