摘要: 对象内存模型 一. 栈(Stack) VS. 堆(heap) 栈 由系统自动管理,以执行函数为单位 空间大小编译时确定(参数+局部变量) 函数执行时,系统自动分配一个stack 函数执行结束时,系统立即自动回收stack 堆 在c++中由程序员手动控制 手动分配new和malloc 手动释放dele 阅读全文
posted @ 2015-08-02 12:44 wangxiaobao1114 阅读(543) 评论(0) 推荐(0) 编辑
摘要: 二 Class with pointer members(Class String) 1. 测试代码(使用效果) 2 Big three(三种特殊函数) 2.1 ctor & dtor(构造与析构) 2.2 Class with pointer members必须有copy ctor(拷贝构造)和c 阅读全文
posted @ 2015-08-02 10:49 wangxiaobao1114 阅读(314) 评论(0) 推荐(0) 编辑
摘要: Introduce class without pointer members, take Class Complex as an example 阅读全文
posted @ 2015-08-02 10:03 wangxiaobao1114 阅读(484) 评论(0) 推荐(0) 编辑