keywords:using

C++ Reference

using

The using keyword is used to import a namespace (or parts of a namespace) into the current scope. Example code: For example, the following code imports the entire std namespace into the current scope so that items within that namespace can be used without a preceeding “std::”.

   using namespace std;

Alternatively, the next code snippet just imports a single element of the std namespace into the current namespace:

   using std::cout;

Related Topics: namespace