Micron Document
The C Programming Language, Ansi C


← Prev · 99/277 · Next →

"

or


filename


is replaced by the contents of the file

filename

. If the

filename

is quoted, searching for the file typically begins where the source program
was found; if it is not found there, or if the name is enclosed in < and
, searching follows an implementation-defined rule to find the file. An
included file may itself contain


lines.

There are often several #include lines at the beginning of a source file, to include common #define statements and extern declarations, or to access the function prototype declarations for library functions from headers like <stdio.h>. (Strictly speaking, these need not be files; the details of how headers are accessed are implementation-dependent.)


A definition has the form


name replacement text

It calls for a macro substitution of the simplest kind - subsequent
occurrences of the token

name

will be replaced by the

replacement text

. The name in a


has the same form
as a variable name; the replacement text is arbitrary. Normally the
replacement text is the rest of the line, but a long definition may be
continued onto several lines by placing a



at the end of each line
to be continued. The scope of a name defined with


is from
its point of definition to the end of the source file being compiled. A
definition may use previous definitions. Substitutions are made only for
tokens, and do not take place within quoted strings. For example, if

YES

is a defined name, there would be no substitution in

printf("YES")

or in

YESMAN

.

Any name may be defined with any replacement text. For example


defines a new word,

forever

, for an infinite loop.