The using keyword starts a using declaration or using directive. A using declaration imports a name from another namespace into the current namespace. It can also be used to introduce a name into a class scope; this is most often used to promote the access level of an inherited member or bring an inherited member into the derived class for overload resolution. A using directive tells the compiler to search an additional namespace when looking up unqualified names. Examplenamespace math { const long double pi = 3.1415926535897932385L; }; using math::pi; long double tan(long double x = pi); int main( ) { using namespace std; cout << "pi=" << math::pi << '\n'; } See Alsoclass, declaration, identifier, namespace, Chapter 2, Chapter 6 |