![](https://csdnimg.cn/release/download_crawler_static/10822100/bg10.jpg)
Free ebooks ==> www.ebook777.com
bility used C, the people who wanted more and more features so they could wallow in
them like moist hundred dollar bills got C++, and everybody was happy.
ISO C99
The C standard underwent a major revision a decade later. Additions were made
for numeric and scientific computing, with a standard type for complex numbers
and some type-generic functions. A few conveniences from C++ got lifted,
including one-line comments (which originally came from one of C’s predecessor
languages, BCPL) and being able to declare variables at the head of for loops.
Using structures was made easier thanks to a few additions to the rules for how
they can be declared and initialized, plus some notational conveniences. Things
were modernized to acknowledge that security matters and that not everybody
speaks English.
When you think about just how much of an impact C89 had, and how the entire
globe was running on C code, it’s hard to imagine the ISO being able to put out
anything that wouldn’t be widely criticized—even a refusal to make any changes
would be reviled. And indeed, this standard was controversial. There are two
common ways to express a complex variable (rectangular and polar coordinates)
—so where does the ISO get off picking one? Why do we need a mechanism for
variable-length macro inputs when all the good code got written without it? In
other words, the purists accused the ISO of selling out to the pressure for more
features.
As of this writing, most compilers support C99 plus or minus a few caveats; the
long double type seems to cause a lot of trouble, for example. However, there is
one notable exception to this broad consensus: Microsoft currently refuses to add
C99 support to its Visual Studio C++ compiler. The section “Compiling C with
Windows” on page 4 covers some of the many ways to compile C code for Win‐
dows, so not using Visual Studio is at most an inconvenience, and having a major
establishment player tell us that we can’t use ANSI- and ISO-standard C only bol‐
sters the punk rock of it all.
C11
Self-conscious about the accusations of selling out, the ISO made few serious
changes in the third edition of the standard. We got a means of writing type-
generic functions, and things were modernized to further acknowledge that secu‐
rity matters and that not everybody speaks English.
The C11 standard came out in December of 2011, but support for the standard
has been implemented by compiler authors at a surprisingly rapid pace, to the
point that a number of major compilers already claim near-complete conform‐
ance. However, the standard defines behavior for both the compiler and the stan‐
dard library—and library support, such as for threading and atomics, is complete
on some systems but catching up on others.
xiv | Preface
www.it-ebooks.info