English
Language : 

CC78K0S Datasheet, PDF (39/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 2 CONSTRUCTS OF C LANGUAGE
2.3.1 Scope of identifiers
The range within which the use of an identifier becomes effective is determined by the location at which the
identifier is declared. The scope of identifiers is divided into the following four types.
• Function scope
• File scope
• Block scope
• Function prototype scope
extern __boolean data1, data2;
void testb (int x);
data1, data2 .................................................... File scope
x............................................... Function prototype scope
void main(void)
{
int cot;
data1=1;
data2=0;
cot................................................................. Block scope
while(data1){
data1=data2;
j1:
testb(cot);
}
}
void testb(int x)
{
.
.
.
j1............................................................. Function scope
x.................................................................... Block scope
(1) Function scope
Function scope refers to the entirety within a function. An identifier with function scope can be referenced from
anywhere within a specified function.
Identifiers that have function scope are label names only.
(2) File scope
File scope refers to the entirety of a translation (compiling) unit. Identifiers that are declared outside a block or
parameter list all have file scope. An identifier that has file scope can be referenced from anywhere within the
program.
User’s Manual U14872EJ1V0UM
39