// namespace-main-5-6.cpp By: Aiman Hanna - ©1993-2006 Aiman Hanna // This program illustrates how namespaces can be extended. // // Key points: 1) Extending namespaces #include "namespace6.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; 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 */