// File: namespace3.cpp // // Simple use of namespace directive #include using namespace std ; // Global Variables int i = 3, j = 4 ; namespace MySpace { int i = 7, j = 8 ; } namespace DS9 { int i = 17, j = 18 ; } main() { // using declarations causes compiler to // make local "aliases" for MySpace::i and MySpace::j using MySpace::i ; using MySpace::j ; cout << "MySpace::i = " << i << endl ; cout << "MySpace::j = " << j << endl ; cout << "DS9::i = " << DS9::i << endl ; cout << endl ; }