2008年11月26日有默认参数的函数:利用成员变量作为成员函数的默认参数
如何在类成员函数中默认引用类成员? class CAbc; class CAbc { private: int m_abc; public: void fun0(int &p=NULL)//编译错误 { printf("%d",p); } void fun1(const int &p=NULL)//编译通过 { printf("%d",p); } void fun2(int &p=this->m_abc)//编译错误 { printf("%d",p); } void fun...
[阅读全文] [PDF]
1 共1条 分1页