34 lines
1.2 KiB
Markdown
34 lines
1.2 KiB
Markdown
[stmt.expr]
|
||
|
||
# 8 Statements [[stmt]](./#stmt)
|
||
|
||
## 8.3 Expression statement [stmt.expr]
|
||
|
||
[1](#1)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/statements.tex#L217)
|
||
|
||
Expression statements have the form
|
||
|
||
[expression-statement:](#nt:expression-statement "8.3 Expression statement [stmt.expr]")
|
||
[*expression*](expr.comma#nt:expression "7.6.20 Comma operator [expr.comma]")opt ;
|
||
|
||
The expression is
|
||
a [discarded-value expression](expr.context#def:discarded-value_expression "7.2.3 Context dependence [expr.context]")[.](#1.sentence-2)
|
||
|
||
Allside effects from an expression statement
|
||
are completed before the next statement is executed[.](#1.sentence-3)
|
||
|
||
An expression statement with the [*expression*](expr.comma#nt:expression "7.6.20 Comma operator [expr.comma]") missing is called
|
||
a [*null statement*](#def:statement,null "8.3 Expression statement [stmt.expr]")[.](#1.sentence-4)
|
||
|
||
[*Note [1](#note-1)*:
|
||
|
||
Most statements are expression statements â usually assignments or
|
||
function calls[.](#1.sentence-5)
|
||
|
||
A null statement is useful to supply a null body to an
|
||
iteration statement such as a while statement ([[stmt.while]](stmt.while "8.6.2 The while statement"))[.](#1.sentence-6)
|
||
|
||
â *end note*]
|