c/language/expressions

An expression is a sequence of operators and their operands, that specifies a computation.

Expression evaluation may produce a result (e.g., evaluation of produces the result ), may generate side-effects (e.g. evaluation of  sends the character  to the standard output stream), and may designate objects or functions.

General

 * (lvalue, non-lvalue object, function designator) classify expressions by their values
 * of arguments and subexpressions specifies the order in which intermediate results are obtained

Operators

 * defines the order in which operators are bound to their arguments
 * are alternative spellings for some operators

Conversions

 * take place when types of operands do not match the expectations of operators
 * may be used to explicitly convert values from one type to another.

Other

 * s can be evaluated at compile time and used in compile-time context (array sizes, static initializers, etc)

Primary expressions
The operands of any operator may be other expressions or they may be primary expressions (e.g. in, the operands of operator+ are the subexpression and the primary expression ).

Primary expressions are any of the following: @1@ Constants and literals (e.g. or ) @2@ Suitably declared s (e.g. or )

Any expression in parentheses is also classified as a primary expression: this guarantees that the parentheses have higher precedence than any operator.

Constants and literals
Constant values of certain types may be embedded in the source code of a C program using specialized expressions known as literals (for lvalue expressions) and constants (for non-lvalue expressions)


 * s are decimal, octal, or hexadecimal numbers of integer type.
 * s are individual characters of type suitable for conversion to a character type or of type
 * s are values of type, , or


 * s are sequences of characters of type or  that represent null-terminated strings

Unevaluated expressions
The operands of the are expressions that are not evaluated. Thus, does not perform console output.