• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

Double :: ?

What does the "::" mean in front of GetPrivateProfileString?
    ::GetPrivateProfileString("SECTION", "Area", "", szBuffer, sizeof(szBuffer), "MY.INI");
0
sticar
Asked:
sticar
  • 2
2 Solutions
 
venkateshwarrCommented:
It is called "scope resolution operator", used to resolve the scope of the function GetPrivateProfileString
0
 
sticarAuthor Commented:
resolve the scope?  meaning?
0
 
bcladdCommented:
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
 
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.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now