Boolan——C++面向对象高级编程(上)学习笔记
一、Object Based(基于对象) vs. Object Oriented(面向对象)
Object Based:面对的是单一class的设计
Object Oriented:面对的是多重classes的设计,class与class之间的关系
二、Classes的两个经典分类:
(1)Class without pointer members like:complex
(2)Class with pointer members like:string
三、C++ programs代码基本形式

四、C++与C的输出差异

五、header中的防卫式声明

六、class的声明
(1)构造函数的特殊写法
(2)函数的两种定义方式

七、class template简介

八、inline函数
提高执行效率的一种函数定义方式,即使声明为inline,由编译器最终决定是否inline。

九、access level
public:可以由外界调用
private:不能被外界直接调用
十、参数传递:pass by value vs. pass by reference(to const)
条件允许的情况下,尽量pass by reference

十一、返回值传递:return by value vs. return by reference(to const)

十二、friend(友元)
特性:(1)能自由取得friend的private成员。
(2)相同class的各个objects互为friends(友元)
十三、operater overloading(含this)

operater overloading(不含this)

十四、temp object(临时对象)
不可return by reference,因为它们返回的必定是local object
