Domain-Distinguishing symbols in C + + (double colon::) function
A. Identify scope level B. Identifies which class the member belongs to
C. Limits on the scope of the membership D. Indicate scope of scopes
Scope symbol:: The front is typically the class name, followed by the member name of the class, C + + as an example to avoid different classes have names of the same members and scope to distinguish
For example, A,b represents two classes, and members are represented in A,b. So
A::member represents member members in Class A
B::member represents member members in class B
Global scope symbol (double colon) example
#include <stdio.h>
int count = 0; Global variable 0
void Main ()
{
int count = 10; Local variable 10
printf ("Count =%d/n", count);//local variable masks global variable so the output is 10.
{
int count = 20;
printf ("Count =%d/n",:: Count); Scope symbol indicates reference global variable 0
:: Sort
}
}