64,654
社区成员
发帖
与我相关
我的任务
分享
namespace my
{
doule fetch = 1.2;
}
using namespace std;
using namespace my;
double fetch = 1.3;
int main ()
{
cout<<"fetch "<<fetch<<endl;
}
using namespace std;
int main ()
{
using namespace my;
double fetch = 1.3;
cout<<"fetch "<<fetch<<endl;
}
From the point of view of unqualified name lookup of any name after a using-directive and until the end of the scope in which it appears, every name from namespace-name is visible as if it were declared in the nearest enclosing namespace which contains both the using-directive and namespace-name.