Block statements

A block statement, or compound statement, lets you group any number of data definitions, declarations, and statements into one statement. All definitions, declarations, and statements enclosed within a single set of braces are treated as a single statement. You can use a block wherever a single statement is allowed.

Read syntax diagramSkip visual syntax diagramBlock statement syntax
 
      .----------------------------------.  .---------------.
      V                                  |  V               |
>>-{----+------------------------------+-+----+-----------+-+--}-><
        +-type_definition--------------+      '-statement-'
        +-file_scope_data_declaration--+
        '-block_scope_data_declaration-'
 

A block defines a local scope. If a data object is usable within a block and its identifier is not redefined, all nested blocks can use that data object.