Warning! What C and C++ standards are not!Why language standards are important.
What are the current standards?
Alphabet Soup. What do all those letters stand for?
How to purchase standards from ANSI and NCITS.
Availability of standards in book form.
What's available for free on the Internet?
This fulfills the hope in the code name "C9X", that it would indeed be completed and ratified before the end of the 1990's.
At this time the name of the standard is ISO/IEC 9899:1999. Note that there is no "ANSI" in the name. This update to the C language standard has not been approved by ANSI and is not an American National Standard at this time. There was a public comment submitted to ANSI about the standard, and the author of the comment was not satisfied with the answer. ANSI's procedures require a ballot to approve the standard under these conditions. This ballot is expected to be completed, and the updated standard approved, by the end of April 2000.
The 1999 C Standard is available for purchase from ISO, ANSI, and NCITS. It is being sold as an ISO/IEC standard, not an ANSI one, so the price is quite a bit higher than for the C++ standard. Once ANSI approves the standard, it should become available in the $20.00 (US) price range. For now the closest thing to the finished standard available is the final draft which was released for public comment. It can be downloaded in several formats from the web site of the standards committee.
I have no information as to what, if any, changes were made between this final draft and the finished standard as ratified.
I will post more information as it becomes available to me.
They take it is a personal insult when they ask a question in a newsgroup which discusses standard C or C++ and receive a response indicating that the language provides no answer, along with a suggestion for a more appropriate newsgroup for them to try.
It does seem natural in a way to think that anything you can do, or are trying to do, with your C or C++ compiler on your computer running your operating system is a C or C++ topic, but in many cases it is not.
What some people see as the greatest weakness of the language standards is actually their greatest strength. That is what they leave out, as much as what they put in. Both languages define a standard set of data types, operators, and standard library functions which are as much as possible absolutely independent of the underlying operating system or hardware platform.
This specifically allows each compiler and operating system to supply its own extensions optimized for its environment.
The C language was developed on and for the Unix operating system. The very first C standards, ANSI 1989 and ISO 1990, permanently and officially drew the line separating C from Unix. High level functions provided by C were standardized in the C standard library, which is still a part of C++ to this day, and Unix operating system functions which could be used equally by other languages were removed from the language.
Without this step C and later C++ would never have become the almost universal languages they are today, but would have remained proprietary captives of Unix, like Microsoft's Visual Basic is strictly tied to the various versions of its Windows operating system.
I am not saying that there is anything wrong with proprietary languages for specific operating systems or environments, but they do not and never will have the widespread availability and usability that C and C++ do.
In my job as an embedded systems programmer, I might work on C code for a lowly 8051 family microcontroller, a 16 bit processor, a 32 bit Digital Signal Processor, and C or C++ for a Pentium II, all in the same week. Many times I move between two, perhaps even three, of these environments in the same day.
Generally speaking, on each of these applications I will use at least some non-standard extension to the standard language for such tasks as: interfacing to the operating system, if any; accessing hardware features of the system; accessing hardware specific features of the processor; meeting the real-time requirements of the system; and other reasons.
I usually need to use some inline or separately linked assembly language, and features like memory models (if you think near and far on Intel 16 bit x86 processors is fun, you should see the five different memory spaces provided by 8051 family!), interrupt service routines, and more.
I have absolutely nothing against using such processor, platform, operating system, and compiler specific extensions when they are the tools I need to get the job done. And I don't have the slightest hesitation about discussing them in appropriate usenet forums.
Why are language standards so important to me when I spend so much time outside of them?
It is specifically because I work on more different processors with more different compilers than most professional programmers will see in their entire careers that I must be an expert on what the standard languages are. When I need to write a line of portable code, I need to know without looking through half a dozen references that I am writing standard C or C++, which I can expect to work identically on the 8 bit microcontroller and the 32 bit DSP and everything in between.
So here's my prime directive for programming in C and C++:
The more you step outside the language standard, the better you need to know the standard itself.
The current International Standard for the C++ programming language is ANSI/ISO/IEC 14882:1998 which first became a standard in 1998.
ANSI stands for American National Standards Institute.ISO is the International Organization for Standardization. The ISO name is not derived from the initials of the name in English or any other language. The link explains this if you are interested.
IEC stands for the International Electrotechnical Commission.
ANSI is the United States representative to ISO and IEC, and of other international standards organizations as well. ANSI actively participates in the development and often the administrative work of international standard creation and maintenance.
In many cases ANSI first develops an American standard, which it then submits to ISO and or IEC for adoption as an international standard. When an international standard is ratified with such changes as are made, it then replaces the original ANSI standard.
The term "ANSI Standard" became indelibly linked with the C programming language because ANSI produced the first standard for it.
In the case of C, the original ANSI standard of 1989 became ANSI/ISO/IEC 9899:1990 the next year. There were no substantive changes, just some reformatting and the addition of ISO required sections.
For C++ ANSI and ISO/IEC standardization came at the same time. The first official ANSI/ISO/IEC 14882:1998 International Standard for C++ includes many new features compared to the language first described publically in the first edition of Bjarne Stroustrup's Book, The C++ Programming Language.
The connection is so ingrained that it seems likely that programmers the world over will refer to "ANSI Standard" C and C++ for many years to come.
Originally standards documents were only available in hard copy, but ANSI now makes standards available for purchase electronically at its web store, in English only. After registering and paying for a standard with a credit card you can immediately download it in Adobe PDF format.
Apparently the utility of the Internet combined with a nearly universal format (Adobe Acrobat PDF format, with free reader software available for many platforms) has caused a change in the way standards will be prepared electronically and sold. The price for the ANSI/ISO/IEC 14882:1998 C++ language standard is $18.00 US and the document is 2.49 MB. However theprice for the ANSI/ISO/IEC 9899:1990 C language standard (revised 1997) is $135.00 US and the file is 17.74 MB, despite the fact that the C standard is a much smaller document than the C++ standard. This leads me to think that the C standard (which I have not purchased in this form) might consist of a scanned hardcopy rather than being produced directly from the text electronically as the C++ standard is.
Another place where official versions of many computer standards are available online at reasonable prices is the National Center for Information Technology Standards. As of this writing they have the original ANSI/ISO standard, 9899:1990, available for US$135.00. This is a 13.5 meg PDF file and appears to have been generated by scanning a printed copy. Other national standards bodies that participate in ISO and IEC might well have adopted similar policies, so if you live outside the United States or would prefer standards documents in another language you should contact the appropriate national body. A list of ISO members complete with contact information is available on their site.
Warning: The Annotated ANSI C Standard covers the C language standard as originally adopted in 1990. It does not include any material on the additions and corrections between 1990 and 1995.The Annotated ANSI C Standard
Annotated By Herbert Schildt
Osborne McGraw-Hill 1993
ISBN 0078819520
Herbert Schildt is not held in wide regard by knowledgeable C and C++programmers, and this is the only book with his name on it most of them would ever recommend. The format of the book places the text of the standard on the left hand pages side-by-side with Schildt's annotations on the right hand side.
While many of Schildt's comments are incorrect and flatly contradict the actual text of the standard on the facing page, the standard itself is complete except for one missing page.
Unfortunately this book is now out of print. Those interested might hunt around for new or used bookstores which might still have copies available.
Dr. Bjarne Stroustrup, the creator of the C++ programming language, indicates that he and Andrew Koenig are working on an annotated book based on the final international standard. He predicts that it will be available in late 1999 or early 2000.
CD2 of the C++ standard is very similar, but not exactly the same, as the final standard. It is available in PDF or Post Script format at the link.
The current C language standard was formalized too long ago for CDs to have been published on the web. However there is currently a major update to the C standard which is nearing completion. Commonly referred to as "C9X" in the expectation that it will be ratified sometime in 1999, it will add many new features, functions, and data types to C.
A draft referred to as FCD for Final Committee Draft is available for public comment now. Like the C++ draft described above, the FCD is probably very close to what the final standard will be.
Warning: The C9X FCD contains many changes to the language from the current standard without identifying them as such. Because of this, this document is not recommended for anyone who is not already extremely familiar with the current C standard. It can cause a great deal of confusion because many of the features, functions, and data types which it defines are not compatible with current C compilers.