answersLogoWhite

0

A global object is any object instantiated in the global namespace. The global namespace is anonymous, so if we don't explicitly specify a namespace prior to instantiating an object, that object will be instantiated in the global namespace:

int x; // global

namespace n {

int x; // non-global

};

To refer to the non-global, we must use namespace resolution:

x = 42; // assign to the global

n::x = 42; // assign to the non-global

User Avatar

Wiki User

7y ago

What else can I help you with?