SOME NEW FEATURES OF C99 (VS. ANSI C) 1. The characters // now begin a comment that ends at the end of the line. 2. Variable declarations can appear anywhere within a code block; no longer must variables be defined at the top of a code block or outside all functions. 3. Variable declarations (and initializations) can appear in for loops, as in for (int i = 0; i < n; i++) ... 4. The length of an array can be an expression whose value is not known until run-time; no longer must the length of any dimension of an array be known at compile-time. 5. The header file stdbool.h defines type bool (meaning boolean) and symbolic constants true and false. 6. Functions must declare a return value; no longer does the type default to int if no type is specified. 7. There is a new type long long which is at least 64 bits and can be either signed or unsigned. The new suffixes "LL" or "ll" (and "ULL" or "ull") are used for constants of the new long long type. 8. Function-like macros can accept a variable number of arguments by using the ellipsis (...) notation. For replacement, the variable arguments (including the separating commas) are "collected" into one single extra argument that can be referenced as __VA_ARGS__ within the macro's replacement list, as in #define DEBUG(format,...) fprintf(stderr,format,__VA_ARGS__) 9. The members of a struct can now be initialized by name, such as in struct {float x, y, z;} s = { .y = 1.0, .x = 3.5, .z = 12.8}; 10. The last member of a struct may be an incomplete array type, such as in struct {int n; char s[]} string; 11. The inline keyword allows functions to be defined as inline, which is a hint to the compiler that invocations of such functions can be replaced with inline code expansions rather than actual function calls. 12. The restrict keyword allows pointers to be defined as restricted, which is a hint to the compiler to disallow two restricted pointers from being aliases to the same object which allows for certain optimizations when dealing with the said pointers. 13. There are new number types _Complex and _Imaginary. 14. There are new library functions, such as snprintf 15. There are new header files, such as and . 16. Multiple uses of a type qualifier are ignored after the first occurence: If a type qualifier appears several times (either directly or indirectly through typedefs) in a type specification, it's treated as if it appeared only once. E.g. const const int x; is the same as const int x; CS-223-02/06/13