093-C++

来源:互联网 发布:js改变color 编辑:程序博客网 时间:2024/06/04 03:54
#include <iostream>using namespace std; // 第一个命名空间namespace first_space{   void func(){      cout << "Inside first_space" << endl;   }}// 第二个命名空间namespace second_space{   void func(){      cout << "Inside second_space" << endl;   }}using namespace first_space;int main (){    // 调用第一个命名空间中的函数   func();      return 0;}
#include <iostream>using namespace std; // 第一个命名空间namespace first_space{   void func(){      cout << "Inside first_space" << endl;   }   // 第二个命名空间   namespace second_space{      void func(){         cout << "Inside second_space" << endl;      }   }}using namespace first_space::second_space;int main (){    // 调用第二个命名空间中的函数   func();      return 0;}


原创粉丝点击