Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) operator::

 

operator:: (pronounced as 'scope operator') is an operator to determine the namespace used.

 

The example below shows how to call a function in the global namespace and that std::cout is in the std namespace.

 

#include <iostream>

void X()
{
  std::cout << "Hello world\n";
}

int main()
{
  ::X(); //Scope operator can be omitted
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict