Scope describes the area of source code within which an identifier is visible, and therefore accessible. This area of source code is always confined to an area within the current translation unit, i.e. the current source file and all header files that are referenced in its #include statements. Scope should not be confused with Linkage. Linkage describes the way that identifiers in different translation units can be made to refer to the same object.
Four different scopes are described in the C language.
An identifier has file scope when its declaration is situated outside any function definition. An identifier declared at file scope is visible from its point of declaration to the end of the translation unit.
An identifier has block scope when its declaration occurs inside a function definition, i.e. within a code block. A block in the C language is any section of code contained within a pair of curly braces { ... }. An identifier declared at block scope is visible from the point of declaration up to the end of the current block (i.e. the closing brace). Note that it is incorrect to describe any identifier other than a label as having function scope. The correct term is block scope. Function scope is described below.
Labels always have function scope. They are visible throughout the entire scope of the function in which they are declared, both forwards and backwards from the point of declaration.
A parameter in a function prototype has a limited scope which extends from its point of declaration to the closing parenthesis at the end of the parameter list.
An identifier declaration at either file scope or block scope can be hidden by a declaration of the same identifier at a narrower scope within the same name space.