#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;
}