摘要: Understand the ins and outs of inlining.[原理]Inline函数背后的做法是将“对函数的每一个调用”都用函数本体(function body)替换之。其好处是:可以消除函数调用所带来的开销。编译器最优化机制通常被设计用来浓缩那些“不含函数调用”的代码,因此当你... 阅读全文
posted @ 2015-03-28 17:01 Eric Z 阅读(741) 评论(0) 推荐(0) 编辑
摘要: Declare destructors virtual in polymorphic base classes.[原理]C++指出,当derived class对象经由一个由base class类型的指针删除时,如果这个base class 拥有一个non-virtual的析构函数,那个析构的结果将... 阅读全文
posted @ 2015-03-26 05:47 Eric Z 阅读(387) 评论(0) 推荐(0) 编辑
摘要: 参考1:关于如何使用System.Data.SQLite的入门:http://www.dreamincode.net/forums/topic/157830-using-sqlite-with-c%23/ 1 using System; 2 using System.Collections.Ge... 阅读全文
posted @ 2015-02-12 15:05 Eric Z 阅读(407) 评论(0) 推荐(0) 编辑
摘要: 我在 centos6.4上安装了gcc4.8.0,第一次使用gdb进行代码调试时遇到如下问题:Missing separate debuginfos, use: debuginfo-install libgcc-4.4.7-3.el6.i686 libstdc++4.4.7-3.el6.i686解决方法:1. 执行debuginfo-install libgcc-4.4.7-3.el6.i686 libstdc++4.4.7-3.el6.i686但是会遇到找不到pkg的问题:Could not find debuginfo for main pkg:libgcc-4.4.7-3.el6.i68 阅读全文
posted @ 2013-05-25 08:31 Eric Z 阅读(1304) 评论(0) 推荐(0) 编辑
摘要: First thing of first. 我的CentOS6.4系统是按照CentOS-6.4-x86_64-bin-DVD1.iso安装的,也就是说只安装了操作系统,而没有安装DVD2中的任何软件。所以我的OS中没有任何GCC 或者C编译器。如果你在安装中遇到各种奇怪错误,比如compiler missing, etc 请按照我的方法应该是没问题滴。其实我的安装方法很简单,也是参考了别人的做法,各种Google出来的。参考一:http://www.oschina.net/code/snippet_54100_10351参考二:http://www.linuxidc.com/Linux/20 阅读全文
posted @ 2013-05-17 18:58 Eric Z 阅读(682) 评论(0) 推荐(0) 编辑