Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Double :: ?

Posted on 2004-03-30
4
198 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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…

789 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