2005年4月10日

Item08. 多级指针(Pointers to Pointers)

摘要: Item08. Pointers to Pointers指向指针的指针(多级指针)与指针有相同的地方也有不同的地方--------------------------------------------1、改变指针的地址指向void scanTo( const char **p, char c )... 阅读全文

posted @ 2005-04-10 19:49 张大大123 阅读(86) 评论(0) 推荐(0) 编辑

2005年4月9日

Item07. 常量与指针的联姻(Const Pointers and Pointers to Const)

摘要: Item07. Const Pointers and Pointers to Const由于常量与指针联姻的方式不同形成了多种貌合神离的结晶:常量指针、指向常量的指针、指向常量的常量指针--------------------------------------------------------... 阅读全文

posted @ 2005-04-09 11:27 张大大123 阅读(77) 评论(0) 推荐(0) 编辑

2005年4月8日

Item06.数组形参 Array Formal Arguments

摘要: Item06. Array Formal Arguments谨慎使用------------------------------------------退化(decay):数组自动地转化为指向其首元素的指针---------------------------------------------1... 阅读全文

posted @ 2005-04-08 17:20 张大大123 阅读(64) 评论(0) 推荐(0) 编辑

Item 05. 引用(References Are Aliases, Not Pointers)

摘要: Item 05. References Are Aliases, Not Pointers 1、引用与指针的三大区别: 没有空引用, 引用声明时即需初始化(生则带来,死则带去), 引用总是引用初始化它的对象(一生一个)2、用引用来传递参数是个不错的主意3、非常量引用不能作为字面常量和临时变量的... 阅读全文

posted @ 2005-04-08 17:18 张大大123 阅读(100) 评论(0) 推荐(0) 编辑

Item03. 设计模式 & Item04. STL

摘要: Item03. Design Patterns设计模式:有用!《设计模式》GoF《泛型程序设计》---------------------------Item04. The Standard Template Library STL:深入学习,广泛使用《C++标准程序库》 阅读全文

posted @ 2005-04-08 17:15 张大大123 阅读(111) 评论(0) 推荐(0) 编辑

Item02.多态 Polymorphism

摘要: Item02. Polymorphism --------------------------polymorphic type: 拥有虚函数的类type(class type)polymorphic object:拥有多个type的对象polymorphic base class:供polymo... 阅读全文

posted @ 2005-04-08 17:12 张大大123 阅读(94) 评论(0) 推荐(0) 编辑

M总语录之导一下

摘要: ……“M老师,我们这个动态感知功能有问题,按着鼠标,系统就down了。”看到M总来到我旁边,我赶快汇报刚发现的bug。“...在鼠标移动的时候,判断一下是否按下鼠标的任一个键,如果没按下我们就启用动态感知功能。”M总想了一下吩咐道。这还不简单,心想。于是刷刷的写下了如下代码://……if( (.... 阅读全文

posted @ 2005-04-08 17:01 张大大123 阅读(175) 评论(0) 推荐(0) 编辑

Item01: 数据提取(Data Abstraction)

摘要: Item01: Data Abstraction--------------------------------------------type是一系列的操作abstract data type 是一系列的拥有实现的操作---------------------------------------... 阅读全文

posted @ 2005-04-08 09:31 张大大123 阅读(111) 评论(0) 推荐(0) 编辑

2005年3月26日

使用Singleton需要考虑内存释放

摘要: GoF[p84]所说的Singleton没有考虑到内存的释放解决方法:1、加入一个成员函数DestroyInstance()来释放内存,在整个工程中需且仅需调用DestroyInstance()一次。2、ME中说用智能指针 阅读全文

posted @ 2005-03-26 15:26 张大大123 阅读(100) 评论(0) 推荐(0) 编辑

std::oststream VS std::ostringstream

摘要: 用如下程序段在for循环中分别测试std::oststream 和 std::ostringstream,可以发现std::oststream 有内存泄露,最好使用std::ostringstream。 std::ostringstream oss, oss2; std::string ... 阅读全文

posted @ 2005-03-26 15:13 张大大123 阅读(138) 评论(0) 推荐(0) 编辑

导航