Introduction to Programming and C++

Contents Previous Topic Next Topic

The #include preprocessor directive performs a simple inclusion of the specified header file. There are two possible forms of this directive; the first form is

#include <header>

where the angled brackets specifies to the preprocessor that the header file should be fetched from the C++ Standard Library where it will search for the header file header.h.

The second form is

#include "header.h"

The preprocessor will search in the working directory to find the header file header.h.

Note: some people may use .hpp for C++ header files, leaving .h for C header files. This is not compliant with the C++ Standard.

C++ Standard Libraries

The C++ Standard Libraries (referenced) include:

  • Containers
    • <bitset>
    • <deque>
    • <list>
    • <map>
    • <queue>
    • <set>
    • <stack>
    • <vector>
  • General
    • <algorithm>
    • <functional>
    • <iterator>
    • <locale>
    • <memory>
    • <stdexcept>
    • <utility>
  • Strings
    • <string>
  • Streams and Input/Output
    • <fstream>
    • <ios>
    • <iostream>
    • <iosfwd>
    • <iomanip>
    • <istream>
    • <ostream>
    • <sstream>
    • <streambuf>
  • Numerics
    • <complex>
    • <numeric>
    • <valarray>
  • Language Support
    • <exception>
    • <limits>
    • <new>
    • <typeinfo>

In addition to these new libraries, a number of C libraries are available:

  • <cassert>
  • <cctype>
  • <cerrno>
  • <cfloat>
  • <climits>
  • <cmath>
  • <csetjmp>
  • <csignal>
  • <cstdlib>
  • <cstddef>
  • <cstdarg>
  • <ctime>
  • <cstdio>
  • <cstring>
  • <cwchar>
  • <cwctype>

Contents Previous Topic Top Next Topic