Name

statement — Statement syntax

Synopsis

               statement ::= labeled-stmt | expr-stmt | compound-stmt | decl-stmt | try-block | 
    if ( condition ) statement | if ( condition ) statement else statement | 
    switch ( condition ) statement | while ( condition ) statement | 
    do statement while ( expression ) | 
    for ( for-init-stmt [condition] ; [expression] ) statement | break ; | 
    continue ; | goto identifier ; | return [expression] ;
expr-stmt ::= [expression] ;
compound-stmt ::= { [statement-seq] }
statement-seq ::= statement | statement-seq
               labeled-stmt ::= identifier : statement | case constant-expr : statement | 
    default : statement
               decl-stmt ::= block-decl
               for-init-stmt ::= expr-stmt | simple-decl
               condition ::= expression | type-specifier-seq 
               declarator = assignment-expr
            

See Chapter 4 for a complete discussion of statements.

See Also

break, case, continue, declaration, declarator, default, do, else, expression, for, goto, if, return, switch, try, type, while, Chapter 4

Get C++ In a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.