// File: namespace1.cpp // // Simple use of namespaces #include namespace MySpace { int i = 7, j = 8 ; } namespace DS9 { int i = 17, j = 18 ; } main() { using std::cout ; using std::endl ; cout << "MySpace::i = " << MySpace::i << endl ; cout << "DS9::i = " << DS9::i << endl ; cout << endl ; { // new block scope using MySpace::i ; cout << "using MySpace::i" << endl ; cout << "Which i? i = " << i << endl ; cout << endl ; } { // another block scope using DS9::i ; cout << "using DS9::i" << endl ; cout << "Which i? i = " << i << endl ; cout << endl ; } }