Design
C99 is, for the most part, backward compatible with C89 but is stricter in some ways.
In particular, a declaration that lacks a type specifier no longer has int
implicitly assumed. The C standards committee decided that it was of more value for compilers to diagnose inadvertent omission of the type specifier than to silently process legacy code that relied on implicit int
. In practice, compilers are likely to display a warning, then assume int
and continue translating the program.
C99 introduced several new features, many of which had already been implemented as extensions in several compilers:
- inline functions
- intermingled declarations and code: variable declaration is no longer restricted to file scope or the start of a compound statement (block), similar to C++
- several new data types, including
long long int
, optional extended integer types, an explicit boolean data type, and acomplex
type to represent complex numbers - variable-length arrays
- support for one-line comments beginning with
//
, as in BCPL or C++ - new library functions, such as
snprintf
- new header files, such as
stdbool.h
,complex.h
,tgmath.h
, andinttypes.h
- type-generic math functions
- improved support for IEEE floating point
- designated initializers
- compound literals
- support for variadic macros (macros with a variable number of arguments)
restrict
qualification allows more aggressive code optimization- universal character names, which allows user variables to contain other characters than the standard character set
Parts of the C99 standard are included in the current version of the C++ standard, C++11, including integer types, header files, and library functions. Variable-length arrays are not among these included parts because C++'s Standard Template Library already includes similar functionality.
Read more about this topic: C99
Famous quotes containing the word design:
“Teaching is the perpetual end and office of all things. Teaching, instruction is the main design that shines through the sky and earth.”
—Ralph Waldo Emerson (18031882)
“I begin with a design for a hearse.
For Christs sake not black
nor white eitherand not polished!
Let it be weatheredlike a farm wagon”
—William Carlos Williams (18831963)
“With wonderful art he grinds into paint for his picture all his moods and experiences, so that all his forces may be brought to the encounter. Apparently writing without a particular design or responsibility, setting down his soliloquies from time to time, taking advantage of all his humors, when at length the hour comes to declare himself, he puts down in plain English, without quotation marks, what he, Thomas Carlyle, is ready to defend in the face of the world.”
—Henry David Thoreau (18171862)