C++ namespace Adding Names into Other Namespaces

Description

C++ namespace Adding Names into Other Namespaces

#include <iostream>

using namespace std;

namespace A/*from  w w w  . j a va 2  s . c  o  m*/
{
    int X;
}

namespace B
{
    using A::X;
}

int main()
{
    A::X = 2;
    cout << B::X << endl;
    return 0;
}



PreviousNext

Related