Include Files
- Also called "header files"; typically have extensions such as .h or .hpp; examples are string.h, math.h, and iostream.h
- They contain all of the declarations for functions provided by the C++ runtime libraries
- There are hundreds of them in a large system such as UNIX; Turbo C++ has about 50 or so
- Only the most trivial programs do not use any functions from the standard libraries, and therefore, do not need to include any header files
- You will almost always need to include iostream.h; it is required if you want to print anything to the screen
The syntax for using include files is:
#include <filename.h>
To include more than one, use multiple statements:
#include <math.h>
#include <iostream.h
#include <string.h>
Previous page
Next page
Back to Lesson 2 Index
Back to Outline