::a=在这里是什么意思,为什么可以这样用,我不太明白
#include <iostream>using namespace std;
int a = 100;
void fun( int &x, int y)
{
x = 10;
y = 20;
}
class ABC
{
public:
ABC(int x=0 )
{
a = x;
b += a;
}
int a;
static int b;
};
int ABC::b =10;
void main()
{
int a = 1, b = 2;
fun(a,b);
cout << "a="<< a <<endl;
cout << "b="<< b <<endl;
ABC obj1;
ABC obj2(2);
cout << "a=" << obj1.a << endl;
cout << "b=" << obj2.b << endl;
cout << "::a="<< ::a <<endl;//::a=在这里是什么意思,为什么可以这样用,我不太明白
}