#include <iostream>using namespace std;class A
{
#define MAX 5 // 宏定义是全局的,因为在预编译时就替换掉了public:typedef unsigned long ULONG; // 作用域局限在这个类中, 且有修饰符private:int _n;ULONG _age;public:A(int n, ULONG age);void display();
};A::A(int n, ULONG age)
{_n = n;_age = age;
}void A::display()
{cout << _n << endl;cout << _age << endl;cout << MAX << endl;
}int main()
{
// typedef unsigned long ULONG; // 作用域在main()中A::ULONG na; // na的类型是A::ULONG, 并非ULONGA a(3, 20);a.display();cout << MAX << endl;na = 25;cout << na << endl;return 0;
}/*运行情况:D:\Desktop\test>makeg++ -o a.exe a2.cppD:\Desktop\test>a3205525
*/