Previous: 3.3 Coding Programs for Readability
Up: 3.3 Coding Programs for Readability
Next: 3.3.2 Macros
Previous Page: 3.3 Coding Programs for Readability
Next Page: 3.3.2 Macros

3.3.1 The C Preprocessor

We have already seen that in order for a program to be run, it must be compiled, i.e. translated from the C language to the machine language of the computer being used. This compilation process takes place in several steps; the source code is read from the file, checked for proper syntax, and analyized for the meaning of the statements in the code. The proper machine language steps to perform these statements can then be generated (and optimized) and then linked with other functions to produce the executable file. At the beginning of this entire process, standard C compilers provide an additional step called the preprocessor. The source code is read from the file and given to the preprocessor where it is translated into a modified source code file which is then given to the compiler proper for translation to machine language. The transformations performed by the preprocessor are directed by lines in the original source file called compiler directives. All such lines begin with the # character as the first non-white space character on the line and are of one of three types of directives: macro definitions, file inclusion, and conditional compilation. Each of these are discussed in the following sections.



Previous: 3.3 Coding Programs for Readability
Up: 3.3 Coding Programs for Readability
Next: 3.3.2 Macros
Previous Page: 3.3 Coding Programs for Readability
Next Page: 3.3.2 Macros

tep@wiliki.eng.hawaii.edu
Wed Aug 17 08:21:42 HST 1994