liveBook · Manning

File scope

File scope is the C scope of an identifier declared outside any function or block and extending to the end of the source file.

How 2 Manning books explain it

Modern C, Third Edition

File scope is the scope of an identifier declared outside a function or block, extending through the relevant source file.

How it is used
Classifies identifiers declared outside function and block delimiters, establishing the outermost level of nested scopes.
How deep it goes
Defines file scope and contrasts it with nested block scope, stopping short of detailed linkage or lifetime rules.
Examples
Uses declarations of main, argc, argv, an array, and a size_t object as file-scope examples.
What you can do after
Evaluate whether a declaration belongs to file scope by checking whether it lies outside parentheses and braces.

Read how Modern C, Third Edition explains file scope →

Modern C

File scope is the C scope of an identifier declared outside any function or block and extending to the end of the source file.

How it is used
Explains how C determines an identifier's visibility when its declaration appears outside any function or block.
How deep it goes
Defines file scope and contrasts it with block scope through declaration locations and visibility ranges.
Examples
Uses main and other declarations written outside function or block boundaries to illustrate file-scope visibility.
What you can do after
Evaluate/understand whether an identifier remains visible through the end of a C source file.

Read how Modern C explains file scope →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.