Solved

Double :: ?

Posted on 2004-03-30
4
194 Views
Last Modified: 2010-04-01
What does the "::" mean in front of GetPrivateProfileString?
    ::GetPrivateProfileString("SECTION", "Area", "", szBuffer, sizeof(szBuffer), "MY.INI");
0
Comment
Question by:sticar
  • 2
4 Comments
 
LVL 12

Assisted Solution

by:venkateshwarr
venkateshwarr earned 50 total points
ID: 10716614
It is called "scope resolution operator", used to resolve the scope of the function GetPrivateProfileString
0
 

Author Comment

by:sticar
ID: 10716622
resolve the scope?  meaning?
0
 
LVL 11

Accepted Solution

by:
bcladd earned 75 total points
ID: 10716695
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
 

Author Comment

by:sticar
ID: 10717561
Ok... Thanks!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now