Names specified here
Name Description Notes Source Availability
CX_LIMITED_RANGE Who knows what this does? P <complex.h> C99 C11
FP_CONTRACT Allow expressions to be contracted P <math.h> C99 C11

An expression indicates how a collection of values are to be combined to perform a computation. When an expression is evaluated, the collection of values is determined, and the computation is performed, yielding a new value, the result. This value has a specific type, and a given expression will always yield values of the same type, hence we can say that the expression also has that type. It can also be given to sizeof to give the size of the type of the expression without actually evaluating it.

One of the simplest expressions is a constant. When evaluated, it yields that value, and its type is the type of that value. For example, 6 is a constant of type int, meaning and yielding the numeric value 6; 6L is a constant of type long, also meaning and yielding the numeric value 6. More complex expressions are possible by recursively combining one or more simpler expressions with one or more operators. The expressions combined with an operator are its operands. For example, 6 + 4 is an expression using the binary operator + to add its two operands 6 and 4 together.

An expression may refer to an object, meaning that, upon evaluation, its value should be retrieved and used in place of the reference. For example, 6 + x is an expression to compute the sum of the current value of the variable x and 6 (without changing x).

Most importantly, C expressions can have side-effects — the only way to change the value stored in an object, or perform some I/O. x = 6 is an expression which assigns the value 6 to the variable x as a side-effect.

expression
assignment-expression
expression , assignment-expression
assignment-expression
conditional-expression
unary-expression assignment-operator assignment-expression
assignment-operator
=
*=
/=
%=
+=
-=
<<=
>>=
&=
^=
|=
conditional-expression
logical-OR-expression
logical-OR-expression ? expression : conditional-expression
logical-OR-expression
logical-AND-expression
logical-OR-expression || logical-AND-expression
logical-AND-expression
inclusive-OR-expression
logical-AND-expression && inclusive-OR-expression
inclusive-OR-expression
exclusive-OR-expression
inclusive-OR-expression | exclusive-OR-expression
exclusive-OR-expression
AND-expression
exclusive-OR-expression ^ AND-expression
AND-expression
equality-expression
AND-expression & equality-expression
equality-expression
relational-expression
equality-expression == relational-expression
equality-expression != relational-expression
relational-expression
shift-expression
relational-expression < shift-expression
relational-expression > shift-expression
relational-expression <= shift-expression
relational-expression >= shift-expression
shift-expression
additive-expression
shift-expression << additive-expression
shift-expression >> additive-expression
additive-expression
multiplicative-expression
additive-expression + multiplicative-expression
additive-expression - multiplicative-expression
multiplicative-expression
cast-expression
multiplicative-expression * cast-expression
multiplicative-expression / cast-expression
multiplicative-expression % cast-expression
cast-expression
unary-expression
( type-name ) cast-expression
unary-expression
postfix-expression
++ unary-expression
-- unary-expression
unary-operator cast-expression
sizeof unary-expression
sizeof ( type-name )
_Alignof ( type-name )
unary-operator
&
*
+
-
~
!
postfix-expression
primary-expression
postfix-expression [ expression ]
postfix-expression ( argument-expression-listopt )
postfix-expression . identifier
postfix-expression -> identifier
postfix-expression ++
postfix-expression --
( type-name ) { initializer-list }
since C99; Structures
( type-name ) { initializer-list , }
since C99; Structures
primary-expression
identifier
constant
string-literal
( expression )
generic-selection
since C11
[ Work in progress : CX_LIMITED_RANGE]
[ Work in progress : FP_CONTRACT]

Missing

  • CX_LIMITED_RANGE
  • FP_CONTRACT

CHaR
Sitemap Supported
Site format updated 2024-06-05T22:37:07.391+0000
Data updated 1970-01-01T00:00:00.000+0000
Page updated 2022-06-17T21:43:05.000+0000