C++笔记第一周(Boolan) 头文件的防卫式声明: ``` #ifndef __Filename__ #define __Filename__ {body} #endif ``` 函数在class body里定义完成则默认inline 函数支持参数支持默认实参 相同的class各个object互为友元 参数为指针可以被改动。为const 引用不可以被改动 运算符重载: 一般运算符重载 A operator+(A&);//成员函数 A operator-(A&); A operator*(A&); A operator/(A&); A operator%(A&); friend A operator+(A&,A&);//友元函数 friend A operator-(A&,A&); friend A operator*(A&,A&); friend A operator/(A&,A&); friend A operator%(A&,A&); 关系运算符重载: bool operator == (const A& ); bool operator != (const A& ); bool operator < (const A& ); bool operator <= (const A& ); bool operator > (const A& ); bool operator >= (const A& ); body之外定义类方法:inline