A block is a grammatical structure that groups declarations and statements inside a delimited program region. In C, braces usually mark a compound statement and its scope boundary. Blocks can nest: a function body contains a for construct, which contains its loop body. section 2.2
Nested blocks in a function
int main(int argc, char* argv[]) { for (...) { /* loop body */ } } The body of main is one block. The for construct forms a primary block, and its body forms a secondary block. Parameters such as argc and argv have visibility throughout the function body. section 2.2
TAKEAWAY
- A declaration has block scope when its visibility extends from the declaration to the end of its enclosing block. section 2.2
- The function body, for construct, and loop body create three nested blocks beneath file scope in the example. section 2.2
- File scope lies outside parentheses and braces; identifiers there are commonly called globals. section 2.2




