Published online by Cambridge University Press: 17 July 2025
Another important feature of C language is that it may include instructions for the compiler. Though these instructions are not directly the part of C language, they expand the scope of programming environment. These are known as preprocessor. In this chapter, we will discuss about these preprocessors.
A unique feature of C language is the preprocessor. The C preprocessor, as its name implies, processes before the processing of C source program. It is a program that processes the source code before the compiler translates the source code into the object code. During processing, these preprocessors perform some modifications on the source code based on the instructions provided by the preprocessors. These instructions are known as preprocessor commands or directives. Each of the Preprocessor directives begin with a # symbol and do not require semicolon(;) at the end. The preprocessor is used to make the source code more readable, much easy to modify, portable and more efficient.
Some common Preprocessor directives are:
• #define directive – To define a symbolic constant or macro.
• #undef directive – To undefine a symbolic constant or macro.
• #include directive – To include another file in a source program.
• Conditional Compilation directive – To compile parts of source code conditionally.
We already discussed about #define and #include directive in brief. Here they would be discussed in details along with other directives.
To save this book to your Kindle, first ensure no-reply@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
Find out more about the Kindle Personal Document Service.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.