随笔分类 -  c/c++

摘要:转载:https://blog.csdn.net/Marble_ccp/article/details/105476092 xml文件读取概述 前面两篇文章对boost读写ini和json做了总结,本文将对boost读写xml做一些详细的总结。和前两者一样,boost中命名空间property_tr 阅读全文
posted @ 2021-03-23 11:06 kouei_kou 阅读(187) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/calmreason/article/details/20908551?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-4.contro 阅读全文
posted @ 2021-03-22 23:19 kouei_kou 阅读(237) 评论(0) 推荐(0)
摘要:conf.xml文件: <?xml version="1.0" encoding="utf-8"?> <span style="font-size:14px;"> <root> <students> <name>张三</name> <name>李四</name> <name>王二</name> </ 阅读全文
posted @ 2021-03-22 16:43 kouei_kou 阅读(41) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/fansongy/article/details/9026407 config.xml <?xml version="1.0" encoding="utf-8"?> <con> <id>1</id> <name>fansy</name> <urls> 阅读全文
posted @ 2021-03-22 15:47 kouei_kou 阅读(106) 评论(0) 推荐(0)
摘要:代码: #include <iostream> #include <boost/filesystem.hpp> #include <boost/filesystem/path.hpp> #include <boost/filesystem/fstream.hpp> int main () { boo 阅读全文
posted @ 2021-03-22 11:33 kouei_kou 阅读(627) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/weixin_30387339/article/details/97729865 注意:当字符串s为“1”时,转换时去掉std::boolalpha。 #include <iostream> #include <sstream> void print 阅读全文
posted @ 2021-03-17 18:04 kouei_kou 阅读(3343) 评论(0) 推荐(0)
摘要:转载:https://www.cnblogs.com/jiangu66/p/3211956.html 解析对象del.xml如下: <root> <delfile> <filenum> 35 </filenum> <paths> <path> <pathname>/tmp/tmp0/</pathna 阅读全文
posted @ 2021-03-17 15:28 kouei_kou 阅读(205) 评论(0) 推荐(0)
摘要:转载:https://blog.csdn.net/mary19920410/article/details/69053361 一、面向过程设计中的static 1、静态全局变量 在全局变量前,加上关键字static,该变量就被定义成为一个静态全局变量。我们先举一个全局变量和静态全局变量的例子,例如, 阅读全文
posted @ 2021-03-11 20:12 kouei_kou 阅读(2063) 评论(0) 推荐(0)
摘要:转载:https://blog.csdn.net/qq_29621351/article/details/80487163 在C/C++中,宏定义的有效范围被规定为当前文件内有效。 “当前文件内有效”分为两种情况,一种是定义在头文件中,另一种是定义在源文件中。 1、在头文件中的宏定义随着头文件一同被 阅读全文
posted @ 2021-03-11 18:18 kouei_kou 阅读(823) 评论(0) 推荐(0)
摘要:转载:https://www.runoob.com/w3cnote/extern-head-h-different.html 用#include可以包含其他头文件中变量、函数的声明,为什么还要 extern关键字?如果我想引用一个全局变量或函数a,我只要直接在源文件中包含 #include<xxx. 阅读全文
posted @ 2021-03-11 18:03 kouei_kou 阅读(404) 评论(0) 推荐(0)
摘要:C+ 全局变量初始化中的nifty counter idiom的原理参考了以下链接: https://www.cnblogs.com/catch/p/4314256.html 本文给出一个可以运行的实例,不对之处请批评指正。 /* class_a.h */ #ifndef _class_h_ #de 阅读全文
posted @ 2021-03-11 14:09 kouei_kou 阅读(251) 评论(0) 推荐(1)
摘要:参考:https://www.cnblogs.com/lustar/p/10717502.html class A { public: A(int i) :a(i){} int getValue(){ return a; } private: int a; }; int main() { A* p1 阅读全文
posted @ 2021-03-10 15:23 kouei_kou 阅读(67) 评论(0) 推荐(0)
摘要:// https://blog.csdn.net/u012234115/article/details/83186386 #include <iostream> #include <string> #include <string.h> #include <stdlib.h> using names 阅读全文
posted @ 2021-03-03 18:02 kouei_kou 阅读(2319) 评论(0) 推荐(1)
摘要:情况是这样的:字面值0是一个int类型而不是指针。如果C发现一个0,在只能使用指针的上下文中,它会不情愿的把0解释为一个空指针,但是那是迫不得已的情况。C的基本策略是0是一个int类型,而不是一个指针类型。 实际上,NULL的真实情况也是这样的。NULL的细节上有一些不确定性,因为各个实现被允许给与 阅读全文
posted @ 2020-04-23 21:44 kouei_kou 阅读(203) 评论(0) 推荐(0)