He's taken this straight from the C standard, example C11 6.8:
A full expression is an expression that is not part of another expression or of a declarator.
Each of the following is a full expression: an initializer that is not part of a compound
literal; the expression in an expression statement; the controlling expression of a selection
statement (if
or switch
); the controlling expression of a while
or do
statement; each
of the (optional) expressions of a for
statement; the (optional) expression in a return
statement. There is a sequence point between the evaluation of a full expression and the
evaluation of the next full expression to be evaluated.
Some examples would be:
if(x)
for(x; y; z)
return x;
where x y and z are full expressions.
Full expression is a language grammar term and not really something a C programmer needs to know about. It is only relevant to "language lawyers" and those making compilers or static analysers. The C standard speaks of statements, blocks and full expressions.
What the programmer might need to know is the last sentences of the above cited text, which means that after a full expression, all side effects of that expression are carried out. So if I write code such as if(i++) printf("%d", i);
then I know that the i++
has been carried out before the printf line.
It may however be quite useful to know these dry grammar terms when reading compiler errors. Such as the infamous "statement missing", that most likely means, in plain English, that you've forgotten a semicolon.
while (condition) { /* ... stuff ... */ }
statement of the loop itself to the best of my read. It isn't a term you should lose sleep over, but do learn to identify the complete extent of a statement, etc.. See C11 - §6.8 Statements and blocks – Intuitionalif (x > 3) x = 2;
thenx = 2;
is an expression statement, hence the expression in it (x = 2
) is a full expression. – Minny