Double :: ?

What does the "::" mean in front of GetPrivateProfileString?
    ::GetPrivateProfileString("SECTION", "Area", "", szBuffer, sizeof(szBuffer), "MY.INI");
sticarAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
bcladdConnect With a Mentor Commented:
In C++ the same name can appear in different scopes: namespace, class, struct. So:

int someFunciton() {
  // global scope
}

class A {
  int someFunction() {
    // in the scope of class A
    // RIGHT HERE: How could you call the global function?
    // Specify the scope of the function as in
    ::someFunction();
  }
};

the full name of the inner function is A::someFunction. The :: with nothing in front of it refers to the global scope.

HTH, -bcl
0
 
venkateshwarrConnect With a Mentor Commented:
It is called "scope resolution operator", used to resolve the scope of the function GetPrivateProfileString
0
 
sticarAuthor Commented:
resolve the scope?  meaning?
0
 
sticarAuthor Commented:
Ok... Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.