Input / output library header files



The I/O library files are those library files which are written on the top of the program, that include pre- written set of function which tells the compiler to perform certain specific task. 
FOR EXAMPLE,:-
 <iostream.h> includes Cin and Cout functions which are used to take inputs from user and display output from the display unit. Some other herders' files are <iomanip.h> , <fstream.h> , <iomath.h>, etc. 


<iostream .h>
:- This header file defines the Cin, Cout,Cerr, Clog. which correspond to the standard output stream. The standard output stream , the unbuffered standard error stream and buffered standard error stream.iostream is the header file which contains all the functions of program like cout, cin etc. and #include tells the preprocessor to include these header file in the program.
    #include is known as a preprocessor directive,which is used to load files… The file iostream.

FOR EXAMPLE:
#include<iostream.h>
#include<conio.h>
int main()
{
    cout<<"hello Engineers";
    getch();
    return 0; 
}


<iomanip.h>
:-This header files declears servies useful for performming formatted input/output with so called parameterized stream manupulator such as set w(), set fill(),set precision(), etc.
The header <iomanip> is part of the Input/output library of the C++ Standard Library. It defines the manipulator functions resetiosflags()setiosflags()setbase()setfill()setprecision(), and setw(). These functions may be conveniently used by C++ programs to affect the state of iostream objects.

FOR EXAMPLE:
#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
int main()
{
    cout<<setw(10);    
    cout<<setpression 3.2427;
    getch();
    return 0;
}

<fstream.h>
:-This header files declares  services  for user controlled file processing.This data type represents the file stream generally, and has the capabilities of both ofstream and ifstream which means it can create files, write information to files, and read information from files. 
                                                                                           To perform file processing in C++, header files <iostream> and <fstream> must be included in your C++ source file.#include <fstream> There are three objects included in the fstream library, which are used to create, write or read files: Object/Data Type. Description. ofstream.

FOR EXAMPLE:
 some classes of <fstream.h>
  1. ofstream:-ofstream is used to write into the file.
  2. ifstream:-ifstream is used to read from the files.
  3. fstream:-fstream is used to write and read from or into the files.


2 comments:

theengineerschoice01@gmail.com