Scope resolution operator

Scoping operator "::"

First, the (scope) :: "a member of scope" = or compare? Or -> to an object.

#if 0
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
int g_number = 100;

void test01()
{
    int g_number = 200;
    cout << g_number << endl;
    // 打印作用于 全局的变量
    cout << ::g_number << endl;
}

class MyClass{
public:
    const static int a = 10;
};

void test02(){
    cout A MyClass :: << endl <<; // what function within a certain scope out access 
/ * the underlying mechanism is unclear implemented    * / 
} 

int main () { 
    Test01 (); 
    System ( " PAUSE " );
     return of EXIT_SUCCESS; 

} 
#endif

 

Guess you like

Origin www.cnblogs.com/MyLoveLiJuan/p/11972912.html