上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 38 下一页
const char*和char const*以及char*const const char*, char const*, char*const的区别问题几乎是C++面试中每次都会有的题目。 事实上这个概念谁都有,只是三种声明方式非常相似很容易记混。 Bjarne在他的The C++ Programming Language里面给出过一个助记的方法: 把一个声明从右向左读。char * const cp; ( * 读成 pointer to ) cp is a const pointer to char const char * p; p is a pointer to const char; Read More
posted @ 2011-02-16 16:03 BloodAndBone Views(873) Comments(0) Diggs(0) Edit
#include <stddef.h>template<typename T>class Singleton{public: static T &getInstance () { if(NULL == instance) { instance = new T(); } return *instance; } static void delInstance () { if(NULL != instance) { delete instance; instance = NULL; } }protected: Singleton () { } ~Sing Read More
posted @ 2011-02-15 15:07 BloodAndBone Views(367) Comments(0) Diggs(1) Edit
http://www.openldap.org/OpenLDAP介绍OpenLDAP是轻型目录访问协议(Lightweight Directory Access Protocol,LDAP)的自由和开源的实现,在其OpenLDAP许可证下发行,并已经被包含在众多流行的Linux发行版中。  它主要包括下述4个部分:    slapd - 独立LDAP守护服务    slurpd - 独立的LDAP更新复制守护服务    实现LDAP协议的库    工具软件和示例客户端gcc -lldap -llber Read More
posted @ 2011-02-14 11:16 BloodAndBone Views(370) Comments(0) Diggs(0) Edit
transform(temp.begin(),temp.end(),temp.begin(),toupper); std::string sl = "hello";transform(sl.begin(), sl.end(), sl.begin(), (int(*)(int))std::toupper);这样得到 sl 值是 大写的 HELLO transform 是遍历一个容器里面元素 然后执行一个操作第1和2个参数是数据起始和结束位置(迭代器)参数3是写入目标的起始位置参数4是执行的操作(函数) Read More
posted @ 2011-02-12 17:10 BloodAndBone Views(502) Comments(0) Diggs(0) Edit
#include &lt;unistd.h&gt;int daemon(int nochdir,int noclose)在创建精灵进程的时候,往往需要将精灵进程的工作目录修改为"/"根目录并且将标准输入,输出和错误输出重定向到/dev/nulldaemon的作用就是当参数nochdir为0时,将根目录修改为工作目录noclose为0时,做输入,输出以及错误输出重定向到/dev/null执行成功返回0错误返回-1 ......string strMetadataPath = str(boost::format("%s/DCManager.xml Read More
posted @ 2011-02-12 17:09 BloodAndBone Views(764) Comments(0) Diggs(1) Edit
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 38 下一页