Header files of c++ unit 3 -topic 3

MOHITTOMAR29 3,578 views 18 slides Aug 05, 2016
Slide 1
Slide 1 of 18
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18

About This Presentation

XI-XII unit 3 computer science ppt


Slide Content

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.h Input 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 > S tandard 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