1 Year
Discussion Span
Last Post by ridhzee sidhu

include Recall that preprocessing is the first step in the C program compilation stage -- this feature is unique to C compilers.

The preprocessor more or less provides its own language which can be a very powerful tool to the programmer. Recall that all preprocessor directives or commands begin with a #.

Use of the preprocessor is advantageous since it makes:

programs easier to develop,
easier to read,
easier to modify
C code more transportable between different machine architectures.
The preprocessor also lets us customise the language. For example to replace { ... } block statements delimiters by PASCAL like begin ... end we can do.

This directive includes a file into code.
It has two possible forms:

#include <file>


     #include "file"

<file> tells the compiler to look where system include files are held. Usually UNIX systems store files in $\backslash$usr$\backslash$include$\backslash$ directory.

"file" looks for a file in the current directory (where program was run from)

Included files usually contain C prototypes and declarations from header files and not (algorithmic) C code (SEE next Chapter for reasons)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.