C++ using指令

#include iostreamusing namespace std;// first name spacenamespace first_space {void func() {cout Inside first_space endl;

编程学习网为您整理以下代码实例,主要实现:C++ using指令,希望可以帮到各位朋友。

#include <iostream>

using namespace std;

// first name space
namespace first_space {
   voID func() {
      cout << "InsIDe first_space" << endl;
   }
}

// second name space
namespace second_space {
   voID func() {
      cout << "InsIDe second_space" << endl;
   }
}

using namespace first_space;
int main () {
   // This calls function from first name space.
   func();

   return 0;
}
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐