2015年4月19日

The initialize list of C++ Class

摘要: 性能问题之外,有些时场合初始化列表是不可或缺的,以下几种情况时必须使用初始化列表常量成员,因为常量只能初始化不能赋值,所以必须放在初始化列表里面Error1(constchar* constmsg) :data(msg){//data = msg; }引用类型,引用必须在定义的时候初始化,并且不能重... 阅读全文

posted @ 2015-04-19 22:05 shoutcharter 阅读(290) 评论(0) 推荐(0) 编辑

Assert

摘要: Assert(false)The system will throw out a exception.使用assert的缺点是,频繁的调用会极大的影响程序的性能,增加额外的开销。在调试结束后,可以通过在包含#include的语句之前插入 #define NDEBUG 来禁用assert调用,示例代码... 阅读全文

posted @ 2015-04-19 18:36 shoutcharter 阅读(121) 评论(0) 推荐(0) 编辑

Array and its point.

摘要: a is the array name.&a is the ponit of 2-D array which contains a[5].the type of &a should be int (*)[5]. oh what is int(*)5............................. 阅读全文

posted @ 2015-04-19 17:07 shoutcharter 阅读(146) 评论(0) 推荐(0) 编辑

导航