November 2001
Beginner
1128 pages
29h 12m
English
Namespaces help organize identifiers used in a program in order to avoid name conflicts. Because the standard library, as implemented with the new header file organization, places names in the std namespace, using these header files requires that you deal with namespaces.
The examples in this book, for simplicity, utilize a using directive to make all the names from the std namespace available:
#include <iostream> #include <string> #include <vector> using namespace std; // a using-directive
However, the wholesale exporting of all the names in a namespace, whether needed or not, runs counter to the goals of namespaces.
Instead, the recommended approach is to use either using declarations or the scope resolution operator (::) to ...
Read now
Unlock full access