// namespace-main-7-8.cpp By: Aiman Hanna - ©1993-2006 Aiman Hanna // This program illustrates how namespaces can be nested. // Key points: 1) Nested namespace #include "namespace8.h" int main() { region3::Greeting(); region3::Calc1 c1(30), c11(45); c1.setValue(32); region4::Calc2 c2; c2.setValue(c1); cout << "The value of object \"c2\" has been set to : " << c2.getValue() << endl; // use the global object - set it to the same value as c1 region4::dup.setValue(c1); cout << "The value of object \"dup\" has been set to : " << region4::dup.getValue() << endl; region3::dup(c1, c11); cout << "The value of object \"c1\" has been set to : " << c1.getValue() << endl; cout << "\n\n=========================================\n"; region3::region31::message1(); region3::region31::region32::message2(); region3::region31::region32::region33::message3(); cout << "=========================================\n"; return 0; } // The result of running the program /* Hello from region 3. The value of object "c2" has been set to : 32 The value of object "dup" has been set to : 32 The value of object "c1" has been set to : 45 ========================================= Hello...there...This is really horrible. ========================================= */