English
Language : 

CC78K4 Datasheet, PDF (133/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler 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 effective file ranges.
A declaration to give a name to external objects by identifiers 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 declaration
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 U15556EJ1V0UM
133