C Programming/Language Reference

ANSI (American National Standards Institute) C (C89)/ISO C (C90)
Very old compilers may not recognize some or all of the C89 keywords,  ,  ,  ,  , as well as any later standards' keywords.

ISO C (C99)
These are supported in most new compilers.

ISO C (C11)
These are supported only in some newer compilers

Although not technically a keyword, C99-capable preprocessors/compilers additionally recognize the special preprocessor operator, which acts as an alternate form of the   directive that can be used from within macro expansions. For example, the following code will cause some compilers (incl. GCC, Clang) to emit a diagnostic message: Some compilers use a slight variant syntax; in particular, MSVC supports   instead of.

Specific compilers may also&#x2014;in a non-standards-compliant mode, or with additional syntactic markers like &#x2014;treat some other words as keywords, including ,  ,  ,  ,  ,  ,  ,  , or. However, they typically allow these keywords to be overridden by declarations when operating in standards-compliant modes (e.g., by defining a variable named ), in order to avoid introducing incompatibilities with existing programs. In order to ensure the compiler can maintain access to extension features, these compilers usually have an additional set of proper keywords beginning with two underscores. For example, GCC treats,  , and   somewhat identically, but the latter two are always guaranteed to have the expected meaning since they can't be overridden.

Many of the newly introduced keywords&#x2014;namely, those beginning with an underscore and capital letter like  or  &#x2014;are intended to be used only indirectly in most situations. Instead, the programmer should prefer the use of standard headers such as  or , which typically use the preprocessor to establish an all-lower-case variant of the keyword (e.g.,  or  ). These headers serve the purpose of enabling C and C++ code, as well as code targeting different compilers or language versions, to interoperate more cleanly. For example, by including, the tokens  ,  , and  can be used identically in either C99 or C++ without having to explicitly use   in C99 or   in C++.

See also the list of reserved identifiers.

Table of operators
Operators in the same row of this table have the same precedence and the order of evaluation is decided by the associativity (left-to-right or right-to-left). Operators closer to the top of this table have higher precedence than those in a subsequent group.

Character sets
Programs written in C can read and write any character set, provided the libraries that support them are included/used.

The source code for C programs, however, is usually limited to the ASCII character set.

In a file containing source code, the end of a line is sometimes, depending on the operating system it was created on not a newline character but compilers treat the end of each line as if it were a single newline character.

Virtually all compilers allow the $, @, and ` characters in string constants. Many compilers also allow literal multibyte Unicode characters, but they are not portable.

Certain characters must be escaped with a backslash to represent themselves in a string or character constant. These are:

Additionally, some compilers allow these characters:


 * Carriage return
 * Alert (audible bell)
 * Backspace

\xhh, where the 'h' characters are hexadecimal digits, is used to represent arbitrary bytes (including \x00, the zero byte).

\uhhhh or \Uhhhhhhhh, where the 'h' characters are hexadecimal digits, is used to portably represent Unicode characters.