The point of header files is to create libraries of
code that can be used over and over. Almost all C++ programs
require some header file to be included. #include< stdio.h > is
the Standard Input and Output header file. #include< iostream.h > is the
Input and Output Stream header file. When the compiler find a reference to
a header file it writes the contents of that header file into the
executable code of your program. This is why compile errors
happen when you leave out the header references. If you try to use cout
without including iostream.h you will get an error.
What we have done here is create a header file with our own integer declaration
that can be referenced in our program. Other header files may contain classes or
other useful code.
List of include files
Common includes iostream.h
Input/Output, interaction with the program. write, getline.
fstream.h
File input/output. open, close, getline
iomanip.h
For manipulating text with width, tabs, etc.
stdlib.h
Standard library for memory allocation, makes it possible to create
integer variables, doubles, floats, etc.
String.h
C++ has no built-in string handling. Use this library to copy strings, find
string length, etc.
stdio.h
Similar to stdlib but also has some file functions. printf, scanf.