2013年5月20日

C++ Primer 读书笔记 - 第五章

摘要: 这一章的内容和C语言基础知识大同小异。1. i++ 与 ++i 的效率问题 i++的话,需要保存原来的值,然后增加 i,之后返回 i 原来的值;++i 直接增加 i,然后返回当前的 i 值,所以少做一步工作。2. Setting the pointer to 0 after the object it refers to has been deleted makes it clear that the pointer points to no object. It is legal to delete a pointer whose value is zero; doing so has .. 阅读全文

posted @ 2013-05-20 10:01 NULL00 阅读(352) 评论(0) 推荐(0) 编辑

C++ Primer 读书笔记 - 第四章

摘要: 这一章更多的是在讲C语言的东西。Pointers to const Objectsconst double *ptrconst Pointersdouble *const ptr = &value //必须初始化const Pointer to a const Objectcosnt double *const ptr = &valuePointers and TypedefsTypedef string *pstringconst pstring cstr;其实const pstring cstr 等价于 string *const cstrconst int *pci_ok 阅读全文

posted @ 2013-05-20 04:11 NULL00 阅读(394) 评论(0) 推荐(1) 编辑

导航