Effective of C++---改变旧有的C习惯
来源:互联网 发布:linux内核招聘 编辑:程序博客网 时间:2024/06/11 19:32
case 1: using const and inline instead of #define
reason :when complier complain a error for "1.653", we may not realize it is a Macro.
1.how to define a const pointer?
const char* const authorName = "Deman Lu";
2.define a static const member in class.
we should define it bouth in class body and in cpp file .
3. may be you can use enum for a const member.
case 1.2 using inline function to define function.
template<class T>
inline const T& max(const T& a, const T& b)
{return a>b ? a:b;}
case 2: using <iostream> instead of <stdio.h> and <iostream.h>
operator>> and operator << can using int, double, sring by default.
case 3:using new and delete instead of malloc and free.
new and delete will call constructors and destructors.
case 4: using C++ annotation instead of C style
using // not /**/
- Effective of C++---改变旧有的C习惯
- <Effective C++: 习惯C++> 笔记
- Effective C++(一)让自己习惯C++
- [Effective C++] 让自已习惯C++
- Effective C++(一)让自己习惯C++
- effective c++-让自己习惯c++
- 《Effective C++》第一章:让自己习惯C++
- 《Effective C++》1-让自己习惯C++
- 【C++】Digest of 《effective C++》--1
- 【C++】Digest of 《effective C++》--2
- 【读书笔记】Effective C++-1 让自己习惯C++(之一)
- 【读书笔记】Effective C++-1 让自己习惯C++(之二)
- 【读书笔记】Effective C++-1 让自己习惯C++(之三)
- 《Effective C++》让自己习惯C++:条款1-条款4
- Effective C++ 读书笔记1——走进C++,简单的习惯
- Effective C++读书笔记1(让自己习惯C++)
- Effective C++读书笔记1(让自己习惯C++)
- Effective C++(一)让自己习惯C++
- Archie OSG Step By Step⑤ 显示位置及拾取
- 第四十三节 java学习——滚动条
- 关于C++ const 的全面总结 .
- 使用svm的一个常见错误
- android内核剖析之binder(系统服务1)
- Effective of C++---改变旧有的C习惯
- Visual C++ TinyXml快速入门(一)
- 值得分享学习的网站和博客
- 我的SEO之路2013年1月3日
- Ubuntu12.04 Rhythmbox 乱码
- 网络爬虫程序
- Ubuntu中文输入法的安装
- 二叉树——特点、性质、存储结构
- Baseline JPEG和Progressive JPEG的区别