C++ 命名空间的使用

// ConsoleApplication1.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include <iostream>
using namespace std;

namespace scope1{
    void test(){
        cout<<"123"<<endl;
    }
}

namespace scope2{
    void test(){
        cout<<"321"<<endl;
    }
}


int _tmain(int argc, _TCHAR* argv[])
{
    scope2::test();
    cin.get();
    return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_40903417/article/details/86554463