// File: namespace5.cpp // // Simple use of namespace directive #include using namespace std ; 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 // // Conflicts with local variables. using MySpace::i ; using MySpace::j ; cout << "MySpace::i = " << i << endl ; cout << "MySpace::j = " << j << endl ; cout << "DS9::i = " << DS9::i << endl ; cout << endl ; // Local Variables i and j. int i = 1001, j = 1005 ; cout << i << j << endl ; }