English
Language : 

CC78K0S Datasheet, PDF (137/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 8 EXTERNAL DEFINITIONS
In a program, lists of external declarations come after the preprocessing. These declarations are referred to as
“external declarations” because they appear outside a function and have valid file ranges.
A declaration to give a name to external objects via an identifier or a declaration to secure storage for a function is
called an external definition. If an identifier declared with external linkage is used in an expression (except the
operand part of the sizeof operator), one external definition for the identifier must exist somewhere in the entire
program.
The syntax of external definitions is given below.
#define TRUE 1
#define FALSE 0
#define SIZE 200
void printf(char*,int);
void putchar(char c);
char mark[SIZE+1];
External object definition
main()
{
int i,prime,k,count;
count=0;
for(i=0;i<=SIZE;i++)
mark[i]=TRUE;
for(i=0;i<=SIZE;i++){
if(mark[i]){
prime=i+i+3;
printf("%d",prime);
count++;
if((count%8)==0) putchar('\n');
for(k=i+prime;k<=SIZE;k+=prime)
mark[k]=FALSE;
}
}
printf("Total %d\n",count);
loop1:
goto loop1;
}
User’s Manual U14872EJ1V0UM
137