ANSI C is a common name for the C programming language standard, and, while the document from which this name derives has long been replaced and superseded, the name is still occasionally used with the current standard. The origin of this standard name (which obviously comes from the American National Standards Institute), as well as the name ISO C (also explicitly drawn from the acronym for the International Organization for Standardization), are tied to the documents that resulted from the voluntary consensus process.
The C programming language predates any of its official standardization by a decade. C was developed at Bell Laboratories in 1972 by Dennis Ritchie, and many of the principles and ideas that he incorporated into the language were taken from earlier programming language B and B’s ancestors BCPL and CPL.
In 1983, ANSI commissioned a committee, X3J11, to standardize the C language. This task fell under the responsibility of the Accredited Standards Committee X3 (ASC X3), Information Technology, and resulted in ANSI X3.159-1989: Programming Language C being ratified on December 14, 1989 and published in the spring of 1990. This original standard unified existing practices, with some new additions.
Please note that ASC X3 is now the International Committee for Information Technology Standards (INCITS), an ANSI-accredited standards developing organization devoted to information and communication technology.
At this time, the standard specified in the ANSI X3.159-1989 document became known as ANSI C, but it was soon superseded as it was adopted as an international standard, ISO/IEC 9899:1990, under the work of ISO/IEC JTC 1. While this originated the name ISO C, the national standard and the international standard also have been differentiated as C89 and C90, respectively.
In the years that succeeded the establishment of the ISO/IEC 9899 international standard, there have been multiple revisions and several corrigenda released. The fourth edition of the standard, ISO/IEC 9899:2018 – Information technology – Programming languages – C defines the current C programming language.
The C language defined by the 2011 edition of the standard has been given the informal name C11. While neither this, nor the names ANSI C and ISO C are ever explicitly mentioned in the standard document, their occasional usage reflects the significance of the hard work carried out by the standards community over the past thirty years in unifying this programming language.
What is the size of integer according to ANSI C ?
Reply me please.
Thanks & Regards
According to any C standard ever published, this is implementation-dependent. A safe bet is the word size of the machine (e.g. 18 bits for a PDP11, or 32 bits for a 386, etc.), but this isn’t guaranteed. If you absolutely need to know the size in address units (for x86, bytes), use sizeof(int).
That answer `sizeof(int)` isn’t complete. It has to be addressable, but if you want to know the size, the standard defines `sizeof(char) = 1` and that `char` has to be uniquely addressable. So if the machine/cpu can’t address something smaller than a 32-bit word, a `char` has to be 32-bits. And all sizes of other types are based on `char`. You can determine the bit-size by `sizeof(int) * CHAR_BIT`. That always fits into an `unsigned char [n]` where `n` is equal to `sizeof(_type_)`.
Looking at the C17 standard and its text is MUCH less readable than the C90 standard text. But the effect, on type sizes at least, is the same.