I'm a beginner, so please let me know the difference between ANSI C and the C programming Language.
-
1If you're a beginner, this is unimportant historical information you should completely ignore. It will only distract you.– user2357112Aug 2, 2014 at 16:17
-
You might like to read here: en.wikipedia.org/wiki/C_%28programming_language%29#History Related also: stackoverflow.com/q/22500/694576– alkAug 2, 2014 at 16:19
-
You can read the C89 rationale, which explains, why certain things were changed (and by that tells you what was changed). Probably the most important changes: function prototypes (look for old-style or K&R function declarations and definitions if you're interested) and the preprocessor (which varied a lot between different implementations).– mafsoAug 2, 2014 at 16:23
Add a comment
|
1 Answer
ANSI is a US standards body that released the first standard specification for C in 1989. The standard was adopted by ISO in 1990 and ISO are now the standards body for the language - not ANSI.
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. However there have been several standards and de-facto standards for C:
- K&R C - as defined by the first edition of The C Programming Language by Brian Kernhigan and Dennis Ritchie, published in 1978.
- ANSI C - 1989 (also known as C89). Described (but no longer defined) by K&R 2nd Ed.
- ISO C 1990 (C90 - more-or-less identical to C89, but in an ISO document).
- ISO C 1999 (C99)
- ISO C 2011 (C11)
-
4While a lot of people think of ANSI C as C89, C11 has also been ratified by ANSI and technically ANSI C is actually C11.– ouahAug 2, 2014 at 16:47
-
4@ouah : Which only serves to make the term ANSI C even more ambiguous and best avoided. Besides it is not quite true; C90 was ratified by ANSI, C99 and C11 were adopted. The ISO C standards committee is an international body - it would be rather parochial to claim it as "American". It is also adopted by by the British Standards Institute, but no one would refer to it as BSI C! In a more practical sense the
-ansi
switch in GCC enforces C90.– CliffordAug 3, 2014 at 7:01 -
1Note that since writing those there is a ISO C17 and a C2x in development - I am not going to maintain this answer, - you get the point.– CliffordMar 8, 2021 at 17:16