SlideShare una empresa de Scribd logo
1 de 7
PREPROCESSORS IN C
BY
SAHITHI NARAPARAJU
INTRODUCTION:

One of the unique feature of C language is
preprocessor.

The preprocessor is a program that processes
the source code before it passes through
compiler.

Pre processor directives are divided into 3
categories:
1.
Macro substitution directives
2.
File inclusion directives
3.
Compiler control directives
MACRO SUBSTITUTION :
 Macro substitution is a process where an
identifier in a program replaced by predefined
string composed of one or more tokens.
 It is achieved by #define directive.
FILE INCLUSION :
 An external file containing functions or macro
definition can be included as apart of program
so that we need not rewrite those function or
macro definition.
 This is achieved by #include directive.
ADDITIONAL PREPROCESSOR
DIRECTIVES
#ELIF DIRECTIVE: #ELIF enables us to establish
an if else if sequence for testing multiple
conditions.
 #PRAGMA DIRECTIVE: #PRAGMA is an
implementation oriented directive that allows us to
specify various instructions to be given to
compiler.
Syntax: #pragma name

#ERROR : #ERROR directive is used to
produce diagnostic messages during
debugging.
Syntax: #error error message.

PREPROCESSOR OPERATORS
There are 2 preprocessor operations namely:
1.
Stringizing operator #
2.
Token pasting operator ##

Stringizing operator #: It is used in definition of
macro functions.
This
operator allows a formal argument within a macro
definition to be converted to a string.
Syntax:
#define sum(XY)printf(#xy”=%fn”,xy);

Token pasting operator ##:
 The token pasting operator enables us to
combine two tokens within a macro definition
to form a single token.
Syntax:
#define combine(string1,string2) s1##s2.

Más contenido relacionado

La actualidad más candente

Function in c program
Function in c programFunction in c program
Function in c programumesh patil
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programmingTejaswiB4
 
Types of Constructor in C++
Types of Constructor in C++Types of Constructor in C++
Types of Constructor in C++Bhavik Vashi
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member FunctionsMOHIT AGARWAL
 
Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).pptAlok Kumar
 
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++HalaiHansaika
 
Module 05 Preprocessor and Macros in C
Module 05 Preprocessor and Macros in CModule 05 Preprocessor and Macros in C
Module 05 Preprocessor and Macros in CTushar B Kute
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C v_jk
 
Unit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in CUnit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in CSowmya Jyothi
 

La actualidad más candente (20)

Function in c program
Function in c programFunction in c program
Function in c program
 
User defined functions
User defined functionsUser defined functions
User defined functions
 
Recursive Function
Recursive FunctionRecursive Function
Recursive Function
 
Constructors and Destructors
Constructors and DestructorsConstructors and Destructors
Constructors and Destructors
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programming
 
Types of Constructor in C++
Types of Constructor in C++Types of Constructor in C++
Types of Constructor in C++
 
Function C programming
Function C programmingFunction C programming
Function C programming
 
Preprocessor
PreprocessorPreprocessor
Preprocessor
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member Functions
 
Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).ppt
 
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++
 
Module 05 Preprocessor and Macros in C
Module 05 Preprocessor and Macros in CModule 05 Preprocessor and Macros in C
Module 05 Preprocessor and Macros in C
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C
 
Constructor and destructor
Constructor  and  destructor Constructor  and  destructor
Constructor and destructor
 
Function in C
Function in CFunction in C
Function in C
 
Functions in c
Functions in cFunctions in c
Functions in c
 
Unit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in CUnit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in C
 
Preprocessor
PreprocessorPreprocessor
Preprocessor
 
Structure of a C program
Structure of a C programStructure of a C program
Structure of a C program
 
Function in c
Function in cFunction in c
Function in c
 

Destacado (20)

Preprocessors
Preprocessors Preprocessors
Preprocessors
 
Pre processor directives in c
Pre processor directives in cPre processor directives in c
Pre processor directives in c
 
The C Preprocessor
The C PreprocessorThe C Preprocessor
The C Preprocessor
 
Macro
MacroMacro
Macro
 
System Programming Unit II
System Programming Unit IISystem Programming Unit II
System Programming Unit II
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
 
Web Project Presentation - JoinPakForces
Web Project Presentation - JoinPakForcesWeb Project Presentation - JoinPakForces
Web Project Presentation - JoinPakForces
 
C++ Preprocessor Directives
C++ Preprocessor DirectivesC++ Preprocessor Directives
C++ Preprocessor Directives
 
Basic Input and Output
Basic Input and OutputBasic Input and Output
Basic Input and Output
 
Sexuality education
Sexuality educationSexuality education
Sexuality education
 
Implementation of c string functions
Implementation of c string functionsImplementation of c string functions
Implementation of c string functions
 
What is c
What is cWhat is c
What is c
 
Chapter 2: The Recording Process
Chapter 2: The Recording ProcessChapter 2: The Recording Process
Chapter 2: The Recording Process
 
Embedded C workshop
Embedded C workshopEmbedded C workshop
Embedded C workshop
 
C string
C stringC string
C string
 
C programming - String
C programming - StringC programming - String
C programming - String
 
Sex education
Sex educationSex education
Sex education
 
String in c
String in cString in c
String in c
 
Overview of c language
Overview of c languageOverview of c language
Overview of c language
 

Similar a pre processor directives in C

Similar a pre processor directives in C (20)

C programming session6
C programming  session6C programming  session6
C programming session6
 
Preprocessor directives in c laguage
Preprocessor directives in c laguagePreprocessor directives in c laguage
Preprocessor directives in c laguage
 
Preprocessor.pptx
Preprocessor.pptxPreprocessor.pptx
Preprocessor.pptx
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programming
 
Preprocessor
PreprocessorPreprocessor
Preprocessor
 
PreProcessorDirective.ppt
PreProcessorDirective.pptPreProcessorDirective.ppt
PreProcessorDirective.ppt
 
Chapter 13.1.11
Chapter 13.1.11Chapter 13.1.11
Chapter 13.1.11
 
1 - Preprocessor.pptx
1 - Preprocessor.pptx1 - Preprocessor.pptx
1 - Preprocessor.pptx
 
Preprocessor directives
Preprocessor directivesPreprocessor directives
Preprocessor directives
 
Unit 5 quesn b ans5
Unit 5 quesn b ans5Unit 5 quesn b ans5
Unit 5 quesn b ans5
 
Unit 5 quesn b ans5
Unit 5 quesn b ans5Unit 5 quesn b ans5
Unit 5 quesn b ans5
 
Ss debuggers
Ss debuggersSs debuggers
Ss debuggers
 
Oosd lecture unit 4 ppt introduction part
Oosd lecture unit 4 ppt introduction partOosd lecture unit 4 ppt introduction part
Oosd lecture unit 4 ppt introduction part
 
6 preprocessor macro header
6 preprocessor macro header6 preprocessor macro header
6 preprocessor macro header
 
Training 8051Report
Training 8051ReportTraining 8051Report
Training 8051Report
 
Explain the motivation behind using a header file for a C program-Solu.docx
Explain the motivation behind using a header file for a C program-Solu.docxExplain the motivation behind using a header file for a C program-Solu.docx
Explain the motivation behind using a header file for a C program-Solu.docx
 
Introduction To C++ programming and its basic concepts
Introduction To C++ programming and its basic conceptsIntroduction To C++ programming and its basic concepts
Introduction To C++ programming and its basic concepts
 
Preprocessor Directive in C
Preprocessor Directive in CPreprocessor Directive in C
Preprocessor Directive in C
 
An Overview of Programming C
An Overview of Programming CAn Overview of Programming C
An Overview of Programming C
 
Unit-2.pptx
Unit-2.pptxUnit-2.pptx
Unit-2.pptx
 

Más de Sahithi Naraparaju

documentation for identity based secure distrbuted data storage schemes
documentation for identity based secure distrbuted data storage schemesdocumentation for identity based secure distrbuted data storage schemes
documentation for identity based secure distrbuted data storage schemesSahithi Naraparaju
 
SYSTEM ARCHITECTURE / UML DIAGRAMS FOR IDENTITY BASED SECURE DISTRIBUTED DATA...
SYSTEM ARCHITECTURE / UML DIAGRAMS FOR IDENTITY BASED SECURE DISTRIBUTED DATA...SYSTEM ARCHITECTURE / UML DIAGRAMS FOR IDENTITY BASED SECURE DISTRIBUTED DATA...
SYSTEM ARCHITECTURE / UML DIAGRAMS FOR IDENTITY BASED SECURE DISTRIBUTED DATA...Sahithi Naraparaju
 
literature survey for identity based secure distributed data storage
literature survey for identity based secure distributed data storage literature survey for identity based secure distributed data storage
literature survey for identity based secure distributed data storage Sahithi Naraparaju
 
Identity based secure distributed data storage schemes
Identity based secure distributed data storage schemesIdentity based secure distributed data storage schemes
Identity based secure distributed data storage schemesSahithi Naraparaju
 
Srs document for identity based secure distributed data storage schemes
Srs document for identity based secure distributed data storage schemesSrs document for identity based secure distributed data storage schemes
Srs document for identity based secure distributed data storage schemesSahithi Naraparaju
 
66913017 java-ring-1217949449014046-9 (1)
66913017 java-ring-1217949449014046-9 (1)66913017 java-ring-1217949449014046-9 (1)
66913017 java-ring-1217949449014046-9 (1)Sahithi Naraparaju
 
Self protecteion in clustered distributed system new
Self protecteion in clustered distributed system newSelf protecteion in clustered distributed system new
Self protecteion in clustered distributed system newSahithi Naraparaju
 
CONSTANTS, VARIABLES & DATATYPES IN C
CONSTANTS, VARIABLES & DATATYPES IN CCONSTANTS, VARIABLES & DATATYPES IN C
CONSTANTS, VARIABLES & DATATYPES IN CSahithi Naraparaju
 
constants, variables and datatypes in C
constants, variables and datatypes in Cconstants, variables and datatypes in C
constants, variables and datatypes in CSahithi Naraparaju
 
Steps for Developing a 'C' program
 Steps for Developing a 'C' program Steps for Developing a 'C' program
Steps for Developing a 'C' programSahithi Naraparaju
 
Self protecteion in clustered distributed system new
Self protecteion in clustered distributed system newSelf protecteion in clustered distributed system new
Self protecteion in clustered distributed system newSahithi Naraparaju
 
A Batch-authenticated And Key Agreement Framework For P2p-based Online Social...
A Batch-authenticated And Key AgreementFramework For P2p-based Online Social...A Batch-authenticated And Key AgreementFramework For P2p-based Online Social...
A Batch-authenticated And Key Agreement Framework For P2p-based Online Social...Sahithi Naraparaju
 

Más de Sahithi Naraparaju (16)

PPT FOR IDBSDDS SCHEMES
PPT FOR IDBSDDS SCHEMESPPT FOR IDBSDDS SCHEMES
PPT FOR IDBSDDS SCHEMES
 
documentation for identity based secure distrbuted data storage schemes
documentation for identity based secure distrbuted data storage schemesdocumentation for identity based secure distrbuted data storage schemes
documentation for identity based secure distrbuted data storage schemes
 
SYSTEM ARCHITECTURE / UML DIAGRAMS FOR IDENTITY BASED SECURE DISTRIBUTED DATA...
SYSTEM ARCHITECTURE / UML DIAGRAMS FOR IDENTITY BASED SECURE DISTRIBUTED DATA...SYSTEM ARCHITECTURE / UML DIAGRAMS FOR IDENTITY BASED SECURE DISTRIBUTED DATA...
SYSTEM ARCHITECTURE / UML DIAGRAMS FOR IDENTITY BASED SECURE DISTRIBUTED DATA...
 
over view of viruses
over view of virusesover view of viruses
over view of viruses
 
literature survey for identity based secure distributed data storage
literature survey for identity based secure distributed data storage literature survey for identity based secure distributed data storage
literature survey for identity based secure distributed data storage
 
Identity based secure distributed data storage schemes
Identity based secure distributed data storage schemesIdentity based secure distributed data storage schemes
Identity based secure distributed data storage schemes
 
Srs document for identity based secure distributed data storage schemes
Srs document for identity based secure distributed data storage schemesSrs document for identity based secure distributed data storage schemes
Srs document for identity based secure distributed data storage schemes
 
66913017 java-ring-1217949449014046-9 (1)
66913017 java-ring-1217949449014046-9 (1)66913017 java-ring-1217949449014046-9 (1)
66913017 java-ring-1217949449014046-9 (1)
 
Self protecteion in clustered distributed system new
Self protecteion in clustered distributed system newSelf protecteion in clustered distributed system new
Self protecteion in clustered distributed system new
 
OVERVIEW OF ‘C’ PROGRAM
OVERVIEW OF ‘C’ PROGRAMOVERVIEW OF ‘C’ PROGRAM
OVERVIEW OF ‘C’ PROGRAM
 
CONSTANTS, VARIABLES & DATATYPES IN C
CONSTANTS, VARIABLES & DATATYPES IN CCONSTANTS, VARIABLES & DATATYPES IN C
CONSTANTS, VARIABLES & DATATYPES IN C
 
constants, variables and datatypes in C
constants, variables and datatypes in Cconstants, variables and datatypes in C
constants, variables and datatypes in C
 
Steps for Developing a 'C' program
 Steps for Developing a 'C' program Steps for Developing a 'C' program
Steps for Developing a 'C' program
 
Self protecteion in clustered distributed system new
Self protecteion in clustered distributed system newSelf protecteion in clustered distributed system new
Self protecteion in clustered distributed system new
 
A Batch-authenticated And Key Agreement Framework For P2p-based Online Social...
A Batch-authenticated And Key AgreementFramework For P2p-based Online Social...A Batch-authenticated And Key AgreementFramework For P2p-based Online Social...
A Batch-authenticated And Key Agreement Framework For P2p-based Online Social...
 
Haptic technology
Haptic technologyHaptic technology
Haptic technology
 

Último

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 

Último (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

pre processor directives in C

  • 2. INTRODUCTION:  One of the unique feature of C language is preprocessor.  The preprocessor is a program that processes the source code before it passes through compiler.  Pre processor directives are divided into 3 categories: 1. Macro substitution directives 2. File inclusion directives 3. Compiler control directives
  • 3. MACRO SUBSTITUTION :  Macro substitution is a process where an identifier in a program replaced by predefined string composed of one or more tokens.  It is achieved by #define directive. FILE INCLUSION :  An external file containing functions or macro definition can be included as apart of program so that we need not rewrite those function or macro definition.  This is achieved by #include directive.
  • 4. ADDITIONAL PREPROCESSOR DIRECTIVES #ELIF DIRECTIVE: #ELIF enables us to establish an if else if sequence for testing multiple conditions.  #PRAGMA DIRECTIVE: #PRAGMA is an implementation oriented directive that allows us to specify various instructions to be given to compiler. Syntax: #pragma name 
  • 5. #ERROR : #ERROR directive is used to produce diagnostic messages during debugging. Syntax: #error error message. 
  • 6. PREPROCESSOR OPERATORS There are 2 preprocessor operations namely: 1. Stringizing operator # 2. Token pasting operator ##  Stringizing operator #: It is used in definition of macro functions. This operator allows a formal argument within a macro definition to be converted to a string. Syntax: #define sum(XY)printf(#xy”=%fn”,xy); 
  • 7. Token pasting operator ##:  The token pasting operator enables us to combine two tokens within a macro definition to form a single token. Syntax: #define combine(string1,string2) s1##s2.