Application of Libraries
To use a library in a file you have to perform three steps. At first, you have to include the header files with the #include
statement, so the compiler knows the names of the library. Because the names of the C++ standard library are in the namespace std
, you can use them in the second step fully qualified or you have to import them in the global namespace. The third and final step is to specify the libraries for the linker to get an executable. This third step is often not necessary. The three steps are explained below.
Include Header Files
The preprocessor includes the file, following the #include
statement. That is most of the time a header file. The header files will be enclosed in angle brackets: