Need an explanation

Hey, I found some code on the internet and there is something I don't
understand. Why is there two colons (::) in front of the GetSystemMetrics
function.

1
2
  double fScreenWidth = ::GetSystemMetrics( SM_CXSCREEN )-1;
  double fScreenHeight = ::GetSystemMetrics( SM_CYSCREEN )-1;


Thanks
:: is the scope operator.
It is probably unnecessary but the author wanted to be sure that if two versions of that function existed, use the one in the current scope.

Last edited on
This is an example of a scope resolution operator without a scope qualifier.
In this case, it refers to the global scope.
The scope operator without a name is known as the global scope operator. This link explains it pretty well: http://stackoverflow.com/questions/75213/scope-resolution-operator-without-a-scope?rq=1
Ohhh thanks guys
Topic archived. No new replies allowed.