Skip to content

Last updated:2026-10-12

C++ Namespaces

About the Author:

Personal WeChat official account:

wechat

  • Global scope operator (::name): used before a type name (class, class member, member function, variable, etc.) to indicate that the scope is the global namespace
  • Class scope operator (class::name): used to indicate that the scope of the given type is a specific class
  • Namespace scope operator (namespace::name): used to indicate that the scope of the given type is a specific namespace

For the concrete code see: maohao.cpp

Comments