SlideShare a Scribd company logo
Header Files of C++
Header files contain definitions of Functions and
Variables, which is imported or used into any C++
program by using the pre-processor #include
statement.
Header file have an extension ".h" which contains C++
function declaration and macro definition.
Why need of header files
When we want to use any function in our C++
program then first we need to import their definition
from C++ library, for importing their declaration and
definition we need to include header file in program
by using #include.
Stdio.hInput and Output operations can also be performed in C++ using
the C Standard Input and Output Library (cstdio, known as stdio.h in the C
language).
When you include iostream.h file in your program ,this file i.e, stdio.h automatically
gets included in your program.
<iostream.h>
• Standard Input / Output Streams Library.
• Cin Standard input stream (object )
• Cout Standard output stream (object )
<conio.h>
• conio.h header used in c programming contains
functions for console input/output.
• console is a term used for the black window, which
is also called as command prompt.
• Some of the most commonly used functions of
conio.h are clrscr, getch,etc.
<iomanip.h>
• This file declares services useful for performing
formatted I/O with so-called parameterized stream
manipulators, such as setw and setprecision.
• setprecision -Sets the decimal precision to be used
to format floating-point values on output
operations.
• Setw- Sets the field width to be used on output
operations.
• The operator used for taking the input is known as
the extraction or get from operator (>>), while the
operator used for displaying the output is known as
the insertion or put to operator (<<).
Example of setprecision
Example of setw
Stringh.h
<math.h>
• Most of the mathematical functions are
defined in math.h ( cmath header in C++).
• The functions that operate on integers, such
as abs , labs , div , and ldiv , are instead
defined in the stdlib.h header ( cstdlib header
in C++).
<stdlib.h>
• This header defines several general purpose
functions, including dynamic memory management,
random number generation, communication with
the environment, integer arithmetics, searching,
sorting and converting.
rand
Header files of c++ unit 3 -topic 3

More Related Content

What's hot

Review functions
Review functionsReview functions
Review functions
Kgr Sushmitha
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2
Koshy Geoji
 
Qno 1 (b)
Qno 1 (b)Qno 1 (b)
Code
CodeCode
Unit 1 of c++ first program
Unit 1 of c++ first programUnit 1 of c++ first program
Unit 1 of c++ first program
AKR Education
 
Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2
Dr. Loganathan R
 
Csc1100 lecture03 ch03-pt1-s14
Csc1100 lecture03 ch03-pt1-s14Csc1100 lecture03 ch03-pt1-s14
Csc1100 lecture03 ch03-pt1-s14
IIUM
 
Csc1100 lecture03 ch03-pt1-s14
Csc1100 lecture03 ch03-pt1-s14Csc1100 lecture03 ch03-pt1-s14
Csc1100 lecture03 ch03-pt1-s14
IIUM
 
Circular queues
Circular queuesCircular queues
Circular queues
Ssankett Negi
 
Queue implementation
Queue implementationQueue implementation
Queue implementation
Rajendran
 
C++20 features
C++20 features C++20 features
C++20 features
LogeekNightUkraine
 
Labsheet_3
Labsheet_3Labsheet_3
Labsheet_3
rohassanie
 
C++ 4
C++ 4C++ 4
C++ 4
Syed Umair
 
Ankita sharma focp
Ankita sharma focpAnkita sharma focp
Ankita sharma focp
AnkitaSharma463389
 
Expression evaluation
Expression evaluationExpression evaluation
Expression evaluation
JeeSa Sultana
 
MEngine Overview
MEngine OverviewMEngine Overview
MEngine Overview
euming
 
Queue Implementation Using Array & Linked List
Queue Implementation Using Array & Linked ListQueue Implementation Using Array & Linked List
Queue Implementation Using Array & Linked List
PTCL
 
Functions
FunctionsFunctions
Functions
Kamal Acharya
 
Pa2 session 7
Pa2 session 7Pa2 session 7
Pa2 session 7
aiclub_slides
 
Tail Recursion in data structure
Tail Recursion in data structureTail Recursion in data structure
Tail Recursion in data structure
Rumman Ansari
 

What's hot (20)

Review functions
Review functionsReview functions
Review functions
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2
 
Qno 1 (b)
Qno 1 (b)Qno 1 (b)
Qno 1 (b)
 
Code
CodeCode
Code
 
Unit 1 of c++ first program
Unit 1 of c++ first programUnit 1 of c++ first program
Unit 1 of c++ first program
 
Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2
 
Csc1100 lecture03 ch03-pt1-s14
Csc1100 lecture03 ch03-pt1-s14Csc1100 lecture03 ch03-pt1-s14
Csc1100 lecture03 ch03-pt1-s14
 
Csc1100 lecture03 ch03-pt1-s14
Csc1100 lecture03 ch03-pt1-s14Csc1100 lecture03 ch03-pt1-s14
Csc1100 lecture03 ch03-pt1-s14
 
Circular queues
Circular queuesCircular queues
Circular queues
 
Queue implementation
Queue implementationQueue implementation
Queue implementation
 
C++20 features
C++20 features C++20 features
C++20 features
 
Labsheet_3
Labsheet_3Labsheet_3
Labsheet_3
 
C++ 4
C++ 4C++ 4
C++ 4
 
Ankita sharma focp
Ankita sharma focpAnkita sharma focp
Ankita sharma focp
 
Expression evaluation
Expression evaluationExpression evaluation
Expression evaluation
 
MEngine Overview
MEngine OverviewMEngine Overview
MEngine Overview
 
Queue Implementation Using Array & Linked List
Queue Implementation Using Array & Linked ListQueue Implementation Using Array & Linked List
Queue Implementation Using Array & Linked List
 
Functions
FunctionsFunctions
Functions
 
Pa2 session 7
Pa2 session 7Pa2 session 7
Pa2 session 7
 
Tail Recursion in data structure
Tail Recursion in data structureTail Recursion in data structure
Tail Recursion in data structure
 

Similar to Header files of c++ unit 3 -topic 3

Chapter 10 Library Function
Chapter 10 Library FunctionChapter 10 Library Function
Chapter 10 Library Function
Deepak Singh
 
Basics of c Nisarg Patel
Basics of c Nisarg PatelBasics of c Nisarg Patel
Basics of c Nisarg Patel
TechNGyan
 
Programming using c++ tool
Programming using c++ toolProgramming using c++ tool
Programming using c++ tool
Abdullah Jan
 
C++ functions presentation by DHEERAJ KATARIA
C++ functions presentation by DHEERAJ KATARIAC++ functions presentation by DHEERAJ KATARIA
C++ functions presentation by DHEERAJ KATARIA
Dheeraj Kataria
 
Header files in c
Header files in cHeader files in c
Header files in c
HoneyChintal
 
C++ functions
C++ functionsC++ functions
C++ functions
Mayank Jain
 
Fp201 unit2 1
Fp201 unit2 1Fp201 unit2 1
Fp201 unit2 1
rohassanie
 
headerfilesinc-181121134545 (1).pdf
headerfilesinc-181121134545 (1).pdfheaderfilesinc-181121134545 (1).pdf
headerfilesinc-181121134545 (1).pdf
jazzcashlimit
 
Chtp415
Chtp415Chtp415
C++ Functions
C++ FunctionsC++ Functions
C++ Functions
sathish sak
 
Functions in c++
Functions in c++Functions in c++
Functions in c++
Abdullah Turkistani
 
Workshop1
Workshop1Workshop1
Workshop1
temkin abdlkader
 
Structure of a C program
Structure of a C programStructure of a C program
Structure of a C program
David Livingston J
 
unit_2 (1).pptx
unit_2 (1).pptxunit_2 (1).pptx
unit_2 (1).pptx
JVenkateshGoud
 
Sachin kumar ppt on programming in c
Sachin kumar ppt on programming in cSachin kumar ppt on programming in c
Sachin kumar ppt on programming in c
Sachin Kumar
 
About the C Libraries which are essential
About the C Libraries which are essentialAbout the C Libraries which are essential
About the C Libraries which are essential
KakashiiHatake3
 
Getting Started Cpp
Getting Started CppGetting Started Cpp
Getting Started Cpp
Long Cao
 
Programming Fundamentals Functions in C and types
Programming Fundamentals  Functions in C  and typesProgramming Fundamentals  Functions in C  and types
Programming Fundamentals Functions in C and types
imtiazalijoono
 
Built in function
Built in functionBuilt in function
Built in function
MD. Rayhanul Islam Sayket
 
Introduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to itIntroduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to it
PushkarNiroula1
 

Similar to Header files of c++ unit 3 -topic 3 (20)

Chapter 10 Library Function
Chapter 10 Library FunctionChapter 10 Library Function
Chapter 10 Library Function
 
Basics of c Nisarg Patel
Basics of c Nisarg PatelBasics of c Nisarg Patel
Basics of c Nisarg Patel
 
Programming using c++ tool
Programming using c++ toolProgramming using c++ tool
Programming using c++ tool
 
C++ functions presentation by DHEERAJ KATARIA
C++ functions presentation by DHEERAJ KATARIAC++ functions presentation by DHEERAJ KATARIA
C++ functions presentation by DHEERAJ KATARIA
 
Header files in c
Header files in cHeader files in c
Header files in c
 
C++ functions
C++ functionsC++ functions
C++ functions
 
Fp201 unit2 1
Fp201 unit2 1Fp201 unit2 1
Fp201 unit2 1
 
headerfilesinc-181121134545 (1).pdf
headerfilesinc-181121134545 (1).pdfheaderfilesinc-181121134545 (1).pdf
headerfilesinc-181121134545 (1).pdf
 
Chtp415
Chtp415Chtp415
Chtp415
 
C++ Functions
C++ FunctionsC++ Functions
C++ Functions
 
Functions in c++
Functions in c++Functions in c++
Functions in c++
 
Workshop1
Workshop1Workshop1
Workshop1
 
Structure of a C program
Structure of a C programStructure of a C program
Structure of a C program
 
unit_2 (1).pptx
unit_2 (1).pptxunit_2 (1).pptx
unit_2 (1).pptx
 
Sachin kumar ppt on programming in c
Sachin kumar ppt on programming in cSachin kumar ppt on programming in c
Sachin kumar ppt on programming in c
 
About the C Libraries which are essential
About the C Libraries which are essentialAbout the C Libraries which are essential
About the C Libraries which are essential
 
Getting Started Cpp
Getting Started CppGetting Started Cpp
Getting Started Cpp
 
Programming Fundamentals Functions in C and types
Programming Fundamentals  Functions in C  and typesProgramming Fundamentals  Functions in C  and types
Programming Fundamentals Functions in C and types
 
Built in function
Built in functionBuilt in function
Built in function
 
Introduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to itIntroduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to it
 

Recently uploaded

How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
sayalidalavi006
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 

Recently uploaded (20)

How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 

Header files of c++ unit 3 -topic 3

  • 1. Header Files of C++ Header files contain definitions of Functions and Variables, which is imported or used into any C++ program by using the pre-processor #include statement. Header file have an extension ".h" which contains C++ function declaration and macro definition. Why need of header files When we want to use any function in our C++ program then first we need to import their definition from C++ library, for importing their declaration and definition we need to include header file in program by using #include.
  • 2. Stdio.hInput and Output operations can also be performed in C++ using the C Standard Input and Output Library (cstdio, known as stdio.h in the C language). When you include iostream.h file in your program ,this file i.e, stdio.h automatically gets included in your program.
  • 3. <iostream.h> • Standard Input / Output Streams Library. • Cin Standard input stream (object ) • Cout Standard output stream (object )
  • 4. <conio.h> • conio.h header used in c programming contains functions for console input/output. • console is a term used for the black window, which is also called as command prompt. • Some of the most commonly used functions of conio.h are clrscr, getch,etc.
  • 5. <iomanip.h> • This file declares services useful for performing formatted I/O with so-called parameterized stream manipulators, such as setw and setprecision. • setprecision -Sets the decimal precision to be used to format floating-point values on output operations. • Setw- Sets the field width to be used on output operations. • The operator used for taking the input is known as the extraction or get from operator (>>), while the operator used for displaying the output is known as the insertion or put to operator (<<).
  • 9.
  • 10.
  • 11.
  • 12. <math.h> • Most of the mathematical functions are defined in math.h ( cmath header in C++). • The functions that operate on integers, such as abs , labs , div , and ldiv , are instead defined in the stdlib.h header ( cstdlib header in C++).
  • 13.
  • 14.
  • 15. <stdlib.h> • This header defines several general purpose functions, including dynamic memory management, random number generation, communication with the environment, integer arithmetics, searching, sorting and converting.
  • 16.
  • 17. rand