ILE C/C++ Language Reference


Preprocessor Directives

A preprocessor directive is a line in a source file that begins with the character # to distinguish it from lines of source program text and that ends with the newline character. The effect of a preprocessor directive is a change to the text of the source code before other translation, and the result is new source code that does not contain the directives. The preprocessed source code must be a valid C or C++ program, because it becomes the input to the compiler.

The syntax of a preprocessor directive is independent of but similar to the syntax of the rest of the language, and the lexical conventions of the preprocessing phase differ from those of the compiler. The normal C and C++ tokens are preprocessed, as well as other characters that enable the recognition of file names, the presence and absence of white space, and the location of end-of-line markers.

Preprocessor directives and the related subject of macro expansion are discussed in this section. After an overview of preprocessor directives, the topics covered include textual macros, file inclusion, ISO standard and predefined macro names, conditional compilation directives, and pragmas.

Related References


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]