郑州商城网站制作,嵊州做网站,阳江网约车,免费网站app软件#include iostreamusing namespace std;class A
{
#define MAX 5 // 宏定义是全局的#xff0c;因为在预编译时就替换掉了public:typedef unsigned long ULONG; // 作用域局限在这个类中, 且有修饰符private:int _n;ULONG _age;public:A(int n, ULONG age);void …#include iostreamusing 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\testmakeg -o a.exe a2.cppD:\Desktop\testa3205525
*/