O'Reilly logo

C Programming Essentials by S. K. Bandyopadhyay, K. N. Dey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. The C Preprocessor

The C preprocessor is a program that processes a C source file before the compiler translates the program into object code. During processing the C source file, it performs certain modifications on the file based upon instructions or directives to the preprocessor. The preprocessor directives are simply commands that start with a # symbol (character). We will examine these directives one by one in this chapter.

Macro Substitution

We have already seen that the #define preprocessor directive is used to create a symbolic constant for use in a program. The general form of this directive is given by:

#define      macro-name replacement—text

where macro-name is replaced with replacement–text through the program.

For example, the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required