1 #include <iostream>
2
3 using namespace std;
4
5 namespace A{
6 int a=10;
7
8 namespace B{
9 int a=20;
10 }
11 }
12
13 int main()
14 {
15 //cout<<A::a<<endl;
16 //using namespace A;
17 //cout<<a<<endl;
18 //using A::a;
19 //cout<<a<<endl;
20
21 //cout<<A::B::a<<endl;
22 //using A::B::a;
23 //cout<<a<<endl;
24 using namespace A::B;
25 cout<<a<<endl;
26 return 0;
27 }
C++学习第二篇_命名空间的自定义和使用
最新推荐文章于 2024-03-30 19:34:04 发布