随笔分类 -  c++

摘要:1. add devtools.repo [testing devtools 2 centos $releasever] name=testing 2 devtools for CentOS $releasever baseurl=http://people.centos.org/tru/d... 阅读全文
posted @ 2016-01-21 20:14 zhifan 阅读(1012) 评论(0) 推荐(0)
摘要:字符串操作在任何语言中都很常用。 本文列举了一些常见的Python/c++ 对字符串的操作。 c++ 的使用了boost libraray, 所涉及到的函数都在 中定义。pythonc++大小写转换'str'.upper(), 'str'.lower()boost::to_upper('str'),... 阅读全文
posted @ 2015-01-06 22:28 zhifan 阅读(845) 评论(0) 推荐(0)
摘要:第一章: 适应c++1. 相比较#define, 更倾向于用const, enum, inline。 #define 在预处理阶段处理,在编译后的文件中找不到任何的symbol, 不利于debug. 而const, enum 则有。 相对于#define, inline 函数既也能减少函数调... 阅读全文
posted @ 2014-11-04 21:57 zhifan 阅读(223) 评论(0) 推荐(0)
摘要:在编译boost.log 的示例程序时,遇到了下面的错误:zhifan$ make boost_log LDFLAGS='-lboost_log-mt'Undefined symbols for architecture x86_64:"boost::log::v2s_mt_posix::recor... 阅读全文
posted @ 2014-11-02 20:49 zhifan 阅读(3083) 评论(0) 推荐(0)
摘要:指向函数的指针有和指向类成员函数的指针的有什么不同?int f(char a, float b);如果它是普通函数,则它的类型是 int (*)(char, float);如果它是非静态成员函数,则它的类型是 int(ClassName::*)(char, float);如果它是静态成员函数,则它的... 阅读全文
posted @ 2014-11-01 21:58 zhifan 阅读(268) 评论(0) 推荐(0)