C++ examples for Statement:namespace
Creating Namespaces
#include <iostream> using namespace std; namespace Player { void PrintName() { //from ww w. ja v a 2s .c o m std::cout << "My name is Bruce!" << endl; } } namespace Vehicle { void PrintName() { std::cout << "I am a car!" << endl; } } using namespace Player; int main(int argc, char *argv []) { PrintName(); Vehicle::PrintName(); return 0; }