SlideShare a Scribd company logo
2
Most read
4
Most read
9
Most read
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
Header files of c++ unit 3 -topic 3
Header files of c++ unit 3 -topic 3
Header files of c++ unit 3 -topic 3
<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++).
Header files of c++ unit 3 -topic 3
Header files of c++ unit 3 -topic 3
<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.
Header files of c++ unit 3 -topic 3
rand
Header files of c++ unit 3 -topic 3

More Related Content

PPTX
Tokens in C++
PDF
C++ Files and Streams
PPTX
File handling in c
PPTX
Input and Output In C Language
PPT
File handling in c
PDF
Introduction to c++ ppt 1
PPT
File handling in C++
Tokens in C++
C++ Files and Streams
File handling in c
Input and Output In C Language
File handling in c
Introduction to c++ ppt 1
File handling in C++

What's hot (20)

PPT
Files in c++ ppt
PPTX
Pointers in c language
PPTX
Introduction to c programming language
PPTX
Compiler vs interpreter
PPTX
Exception handling c++
PPTX
Loops in C Programming Language
PDF
Python programming : Files
PPTX
Variables in C++, data types in c++
PPT
Variables in C Programming
PPSX
Files in c++
PPTX
Programming flowcharts for C Language
PPTX
C Tokens
PPTX
C tokens
DOCX
Features of c language 1
PPTX
Stream classes in C++
PPTX
Object Oriented Programming Using C++
PPSX
Break and continue
PPTX
Interface in java
Files in c++ ppt
Pointers in c language
Introduction to c programming language
Compiler vs interpreter
Exception handling c++
Loops in C Programming Language
Python programming : Files
Variables in C++, data types in c++
Variables in C Programming
Files in c++
Programming flowcharts for C Language
C Tokens
C tokens
Features of c language 1
Stream classes in C++
Object Oriented Programming Using C++
Break and continue
Interface in java
Ad

Viewers also liked (17)

DOCX
Type header file in c++ and its function
PPTX
String .h
PDF
8 header files
PPT
Headerfiles
DOC
Filelist
PDF
Consuming and Creating Libraries in C++
PPTX
The buying brain
PPTX
Intro to c++
PDF
Chapter 10 Library Function
PPTX
20.Namespaces
PPT
ITK Tutorial Presentation Slides-944
PPT
C++ functions
DOC
String in c
PPTX
Java- Nested Classes
PPT
Functions in C++
PDF
file handling c++
PDF
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Type header file in c++ and its function
String .h
8 header files
Headerfiles
Filelist
Consuming and Creating Libraries in C++
The buying brain
Intro to c++
Chapter 10 Library Function
20.Namespaces
ITK Tutorial Presentation Slides-944
C++ functions
String in c
Java- Nested Classes
Functions in C++
file handling c++
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Ad

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

PPTX
U get to UnderstandingBasicStructureC.pptx
PPTX
Functions and Header files ver very useful
PPTX
Basics of c Nisarg Patel
PPTX
Programming using c++ tool
PPT
C++ functions presentation by DHEERAJ KATARIA
PPTX
Header files in c
PPT
C++ functions
PPT
Fp201 unit2 1
PDF
headerfilesinc-181121134545 (1).pdf
PPT
PPT
C++ Functions
PPT
Functions in c++
PPT
Workshop1
PPTX
LectureSlides_2_BasicsIfelseLoops.pptx very
PPTX
STRUCTURED PROGRAMMING (USING C PROGRAMMING).pptx
PPT
Structure of a C program
PPTX
unit_2 (1).pptx
PDF
CP MATERIAL.pdf Computer Programming Material
PPTX
Sachin kumar ppt on programming in c
PPTX
About the C Libraries which are essential
U get to UnderstandingBasicStructureC.pptx
Functions and Header files ver very useful
Basics of c Nisarg Patel
Programming using c++ tool
C++ functions presentation by DHEERAJ KATARIA
Header files in c
C++ functions
Fp201 unit2 1
headerfilesinc-181121134545 (1).pdf
C++ Functions
Functions in c++
Workshop1
LectureSlides_2_BasicsIfelseLoops.pptx very
STRUCTURED PROGRAMMING (USING C PROGRAMMING).pptx
Structure of a C program
unit_2 (1).pptx
CP MATERIAL.pdf Computer Programming Material
Sachin kumar ppt on programming in c
About the C Libraries which are essential

Recently uploaded (20)

PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Classroom Observation Tools for Teachers
PPTX
Institutional Correction lecture only . . .
PDF
01-Introduction-to-Information-Management.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Cell Structure & Organelles in detailed.
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
master seminar digital applications in india
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
O7-L3 Supply Chain Operations - ICLT Program
Insiders guide to clinical Medicine.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Classroom Observation Tools for Teachers
Institutional Correction lecture only . . .
01-Introduction-to-Information-Management.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
GDM (1) (1).pptx small presentation for students
Cell Structure & Organelles in detailed.
Renaissance Architecture: A Journey from Faith to Humanism
master seminar digital applications in india
Microbial disease of the cardiovascular and lymphatic systems
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
VCE English Exam - Section C Student Revision Booklet
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student

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 (<<).
  • 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++).
  • 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.
  • 17. rand