
代码积累
gongzhxu
喜欢编程
展开
-
全局变量初始化顺序
全局变量的初始化一般是根据定义的先后顺序来的,下面有个例子证明(写程序时最好不要出现顺序问题)#include #include class Test{public: static char * _initPTR() { char * p = new char[256]; strcpy(p, "hello, world"); return p; } static原创 2014-01-07 12:59:21 · 1323 阅读 · 0 评论 -
配置文件读取
config_parser.h:#ifndef CONFIG_PARSER_H#define CONFIG_PARSER_H#include <exception>#include <stdio.h>#include <string>#include <map>class ConfigValue{public: Con...原创 2019-03-18 15:45:42 · 255 阅读 · 0 评论 -
linux守护进程
#include <unistd.h>#include <stdio.h>#include <string.h>#include <fcntl.h>#include <errno.h>#include <limits.h>#include <sys/wait.h>#include <sy原创 2019-03-18 15:43:51 · 299 阅读 · 0 评论