SlideShare a Scribd company logo
Presented By:
Deepshikha Haritwal
Satya Prakash Ranjan
 Introduction to preprocessors
 Various preprocessors directives
 The IOSTREAM library
 The IOMANIP library
 Preprocessors are programs that processes the
source code before actual compilation of the
program.
 The preprocessors directives always begin with a ‘#’
symbol.
 The ‘#’ symbol at beginning of statement in a c++
program indicates that it is a preprocessor directive.
 The various kinds of preprocessor directives that
preprocessor looks for are:
 Macros
 File inclusion
 Conditional compilation
 Macros are the piece of code in program which is
given a name.
 Whenever this name is encountered in the program
the compiler replaces the name with the actual piece
of code.
 #define directive is used for this purpose.
#include<iostream>
#define LIMIT 5
using namespace std;
int main()
{
for(int i=0;i<LIMIT;++i)
{
cout<<i<<“n”;
}
return 0;
}
 This type of preprocessor directive tells the compiler
to include a file in the source code program.
 There are two types of files that can be included in
the source program:
 1. Header files or Standard files
 2. User Defined files
 To include header files we write:
 #include<filename>
The <> brackets both delimit the filename and indicate that the
file is to be found in one of the standard directories of system.
 To include user defined files we write:
 #include “filename”
Filename within “ ” indicate that it is a user defined file.
 These directives helps to compile a specific portion of
the program or to skip the compilation of some
specific part of the program based on some
conditions.
 “ifdef”, “endif”, “ifndef” are some of the
preprocessing commands that helps achieving this
purpose.
 #ifdef macroname
Statement 1;
Statement 2;
.
.
.
.
#endif
• If the macroname is defined then the block of
statement will be executed otherwise compiler will
skip the execution of these statements.
 C++ I/O libraries provides an interface between the
program and the hardware devices that make up the
computer system.
 The IOSTREAM header file of c++ defines a
collection of stream classes that are capable of input,
output or both input and output.
 CIN OBJECT:
 It represents the standard input stream.
 It is used along with the extraction operator(>>)
 Example :
int a;
cin>>a;
 COUT OBJECT:
 It represents the standard output stream.
 It used along with the insertion operator(<<)
 Example :
int a=15;
cout<<“Value of a:”<<a;
 CERR OBJECT:
 It is an object of the class ostream.
 It represents the standard error stream.
 Example:
cerr<<“system being rebooted in 2 minutesn”;
• CLOG OBJECT:
• It is an object of the class ostream.
• It represents the standard logging stream.
• Example :
clog<< Username<<“has logged into system”;
 The iomanip library defines a collection of I/O
stream manipulators to modify the behavior of
insertions and extractions.
 It is a library that is used to manipulate the output of
c++ program.
 Setw(int w): it sets the field width to w.
 Setfill(char c): it sets the fill character to c.
 Setbase(int b): used to set the base field to one of the
possible values according to argument base.
 Setprecision(int d): sets the number of places of
accuracy to d.
 Scientific: displays the floating point values in
scientific notation.
 Fixed: displays the floating point values in decimal
notation
 Showpos: positive numbers are
displayed with a leading + sign.
 Showbase: octal numbers are displayed
preceded with 0 and hexadecimal
numbers are displayed preceded with
0x.
 Boolalpha: displays logical values
symbolically as true and false.
 Noboolapha : displays logical values as 0
and 1.
Preprocessor , IOSTREAM Library,IOMANIP Library

More Related Content

PDF
Singly linked list
PPT
Pre-Processing and Data Preparation
PPT
data modeling and models
PPTX
Top 5 algorithms used in Data Science
PPSX
Data structure stack&queue basics
PPTX
Chapter 1
PPTX
Architecture of data mining system
PPTX
Stack and Queue
Singly linked list
Pre-Processing and Data Preparation
data modeling and models
Top 5 algorithms used in Data Science
Data structure stack&queue basics
Chapter 1
Architecture of data mining system
Stack and Queue

What's hot (20)

PDF
The Importance of Data Visualization
PPTX
Data Mining in Healthcare: How Health Systems Can Improve Quality and Reduce...
PPTX
Presentation on data preparation with pandas
PPTX
Intro to JSON
PPTX
Data structure , stack , queue
PDF
Data Visualization with Tableau - by Knowledgebee Trainings
PDF
Big Data : Risks and Opportunities
PDF
PowerBI Training
PDF
Data Analytics For Beginners | Introduction To Data Analytics | Data Analytic...
PDF
Data mining in social network
PPTX
File in C language
PDF
Introduction to Data Science and Analytics
PPTX
Data Preprocessing || Data Mining
PPT
1.8 splay tree
PPT
Chapter 8: tree data structure
PPTX
Data Structure - Elementary Data Organization
PPTX
Lecture-12Evaluation Measures-ML.pptx
PPTX
single linked list
PDF
Tensorflow presentation
PPTX
Seaborn.pptx
The Importance of Data Visualization
Data Mining in Healthcare: How Health Systems Can Improve Quality and Reduce...
Presentation on data preparation with pandas
Intro to JSON
Data structure , stack , queue
Data Visualization with Tableau - by Knowledgebee Trainings
Big Data : Risks and Opportunities
PowerBI Training
Data Analytics For Beginners | Introduction To Data Analytics | Data Analytic...
Data mining in social network
File in C language
Introduction to Data Science and Analytics
Data Preprocessing || Data Mining
1.8 splay tree
Chapter 8: tree data structure
Data Structure - Elementary Data Organization
Lecture-12Evaluation Measures-ML.pptx
single linked list
Tensorflow presentation
Seaborn.pptx
Ad

Similar to Preprocessor , IOSTREAM Library,IOMANIP Library (20)

PPT
Fp201 unit2 1
PPTX
Programming Fundamentals IDE's Lec3.pptx
PDF
Prog1-L1.pdf
PPTX
C++ AND CATEGORIES OF SOFTWARE
PDF
General structure of c++
PPTX
C++ basics
PPT
Workshop1
PDF
C_and_C++_notes.pdf
PPTX
C++ Constructs.pptx
PPTX
Introduction to cpp language and all the required information relating to it
PPTX
Programming using c++ tool
PPTX
computer programming omputer programming
PPTX
basic program
PPTX
Nitin Mishra 0301EC201039 Internship PPT.pptx
PPT
PreProcessorDirective.ppt
PPTX
Introduction to Python.Net
PPTX
Lecture 1
PPTX
Whole c++ lectures ITM1 Th
Fp201 unit2 1
Programming Fundamentals IDE's Lec3.pptx
Prog1-L1.pdf
C++ AND CATEGORIES OF SOFTWARE
General structure of c++
C++ basics
Workshop1
C_and_C++_notes.pdf
C++ Constructs.pptx
Introduction to cpp language and all the required information relating to it
Programming using c++ tool
computer programming omputer programming
basic program
Nitin Mishra 0301EC201039 Internship PPT.pptx
PreProcessorDirective.ppt
Introduction to Python.Net
Lecture 1
Whole c++ lectures ITM1 Th
Ad

More from Meghaj Mallick (20)

PPT
24 partial-orderings
PPTX
PORTFOLIO BY USING HTML & CSS
PPTX
Introduction to Software Testing
PPTX
Introduction to System Programming
PPTX
MACRO ASSEBLER
PPTX
Icons, Image & Multimedia
PPTX
Project Tracking & SPC
PPTX
Peephole Optimization
PPTX
Routing in MANET
PPTX
Macro assembler
PPTX
Architecture and security in Vanet PPT
PPTX
Design Model & User Interface Design in Software Engineering
PPTX
Text Mining of Twitter in Data Mining
PPTX
DFS & BFS in Computer Algorithm
PPTX
Software Development Method
PPTX
Secant method in Numerical & Statistical Method
PPTX
Motivation in Organization
PPTX
Communication Skill
PPT
Partial-Orderings in Discrete Mathematics
PPTX
Hashing In Data Structure
24 partial-orderings
PORTFOLIO BY USING HTML & CSS
Introduction to Software Testing
Introduction to System Programming
MACRO ASSEBLER
Icons, Image & Multimedia
Project Tracking & SPC
Peephole Optimization
Routing in MANET
Macro assembler
Architecture and security in Vanet PPT
Design Model & User Interface Design in Software Engineering
Text Mining of Twitter in Data Mining
DFS & BFS in Computer Algorithm
Software Development Method
Secant method in Numerical & Statistical Method
Motivation in Organization
Communication Skill
Partial-Orderings in Discrete Mathematics
Hashing In Data Structure

Recently uploaded (20)

PPTX
Self management and self evaluation presentation
PPTX
PHIL.-ASTRONOMY-AND-NAVIGATION of ..pptx
PPTX
Human Mind & its character Characteristics
PDF
Nykaa-Strategy-Case-Fixing-Retention-UX-and-D2C-Engagement (1).pdf
PPTX
ART-APP-REPORT-FINctrwxsg f fuy L-na.pptx
PDF
oil_refinery_presentation_v1 sllfmfls.pdf
PPTX
English-9-Q1-3-.pptxjkshbxnnxgchchxgxhxhx
PDF
Tunisia's Founding Father(s) Pitch-Deck 2022.pdf
PPTX
Intro to ISO 9001 2015.pptx wareness raising
PPTX
Project and change Managment: short video sequences for IBA
PPTX
nose tajweed for the arabic alphabets for the responsive
PPTX
Effective_Handling_Information_Presentation.pptx
PPT
First Aid Training Presentation Slides.ppt
DOC
学位双硕士UTAS毕业证,墨尔本理工学院毕业证留学硕士毕业证
PPTX
Role and Responsibilities of Bangladesh Coast Guard Base, Mongla Challenges
PDF
Swiggy’s Playbook: UX, Logistics & Monetization
PPTX
Hydrogel Based delivery Cancer Treatment
PDF
Parts of Speech Prepositions Presentation in Colorful Cute Style_20250724_230...
PPTX
chapter8-180915055454bycuufucdghrwtrt.pptx
PPTX
Introduction-to-Food-Packaging-and-packaging -materials.pptx
Self management and self evaluation presentation
PHIL.-ASTRONOMY-AND-NAVIGATION of ..pptx
Human Mind & its character Characteristics
Nykaa-Strategy-Case-Fixing-Retention-UX-and-D2C-Engagement (1).pdf
ART-APP-REPORT-FINctrwxsg f fuy L-na.pptx
oil_refinery_presentation_v1 sllfmfls.pdf
English-9-Q1-3-.pptxjkshbxnnxgchchxgxhxhx
Tunisia's Founding Father(s) Pitch-Deck 2022.pdf
Intro to ISO 9001 2015.pptx wareness raising
Project and change Managment: short video sequences for IBA
nose tajweed for the arabic alphabets for the responsive
Effective_Handling_Information_Presentation.pptx
First Aid Training Presentation Slides.ppt
学位双硕士UTAS毕业证,墨尔本理工学院毕业证留学硕士毕业证
Role and Responsibilities of Bangladesh Coast Guard Base, Mongla Challenges
Swiggy’s Playbook: UX, Logistics & Monetization
Hydrogel Based delivery Cancer Treatment
Parts of Speech Prepositions Presentation in Colorful Cute Style_20250724_230...
chapter8-180915055454bycuufucdghrwtrt.pptx
Introduction-to-Food-Packaging-and-packaging -materials.pptx

Preprocessor , IOSTREAM Library,IOMANIP Library

  • 2.  Introduction to preprocessors  Various preprocessors directives  The IOSTREAM library  The IOMANIP library
  • 3.  Preprocessors are programs that processes the source code before actual compilation of the program.  The preprocessors directives always begin with a ‘#’ symbol.  The ‘#’ symbol at beginning of statement in a c++ program indicates that it is a preprocessor directive.
  • 4.  The various kinds of preprocessor directives that preprocessor looks for are:  Macros  File inclusion  Conditional compilation
  • 5.  Macros are the piece of code in program which is given a name.  Whenever this name is encountered in the program the compiler replaces the name with the actual piece of code.  #define directive is used for this purpose.
  • 6. #include<iostream> #define LIMIT 5 using namespace std; int main() { for(int i=0;i<LIMIT;++i) { cout<<i<<“n”; } return 0; }
  • 7.  This type of preprocessor directive tells the compiler to include a file in the source code program.  There are two types of files that can be included in the source program:  1. Header files or Standard files  2. User Defined files
  • 8.  To include header files we write:  #include<filename> The <> brackets both delimit the filename and indicate that the file is to be found in one of the standard directories of system.  To include user defined files we write:  #include “filename” Filename within “ ” indicate that it is a user defined file.
  • 9.  These directives helps to compile a specific portion of the program or to skip the compilation of some specific part of the program based on some conditions.  “ifdef”, “endif”, “ifndef” are some of the preprocessing commands that helps achieving this purpose.
  • 10.  #ifdef macroname Statement 1; Statement 2; . . . . #endif • If the macroname is defined then the block of statement will be executed otherwise compiler will skip the execution of these statements.
  • 11.  C++ I/O libraries provides an interface between the program and the hardware devices that make up the computer system.  The IOSTREAM header file of c++ defines a collection of stream classes that are capable of input, output or both input and output.
  • 12.  CIN OBJECT:  It represents the standard input stream.  It is used along with the extraction operator(>>)  Example : int a; cin>>a;  COUT OBJECT:  It represents the standard output stream.  It used along with the insertion operator(<<)  Example : int a=15; cout<<“Value of a:”<<a;
  • 13.  CERR OBJECT:  It is an object of the class ostream.  It represents the standard error stream.  Example: cerr<<“system being rebooted in 2 minutesn”; • CLOG OBJECT: • It is an object of the class ostream. • It represents the standard logging stream. • Example : clog<< Username<<“has logged into system”;
  • 14.  The iomanip library defines a collection of I/O stream manipulators to modify the behavior of insertions and extractions.  It is a library that is used to manipulate the output of c++ program.
  • 15.  Setw(int w): it sets the field width to w.  Setfill(char c): it sets the fill character to c.  Setbase(int b): used to set the base field to one of the possible values according to argument base.  Setprecision(int d): sets the number of places of accuracy to d.  Scientific: displays the floating point values in scientific notation.  Fixed: displays the floating point values in decimal notation
  • 16.  Showpos: positive numbers are displayed with a leading + sign.  Showbase: octal numbers are displayed preceded with 0 and hexadecimal numbers are displayed preceded with 0x.  Boolalpha: displays logical values symbolically as true and false.  Noboolapha : displays logical values as 0 and 1.