Skip to main content Accessibility help
×
Hostname: page-component-6bb9c88b65-6scc2 Total loading time: 0 Render date: 2025-07-25T02:11:54.823Z Has data issue: false hasContentIssue false

18 - Preprocessors

Published online by Cambridge University Press:  17 July 2025

Subrata Saha
Affiliation:
Techno India Hooghly, West Bengal
Subhodip Mukherjee
Affiliation:
Techno India College of Technology, West Bengal
Get access

Summary

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.

Information

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2016

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Book purchase

Temporarily unavailable

Accessibility standard: Unknown

Accessibility compliance for the PDF of this book is currently unknown and may be updated in the future.

Save book to Kindle

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.

Available formats
×

Save book 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 Dropbox.

Available formats
×

Save book to Google Drive

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.

Available formats
×