首页 文章 精选 留言 我的

精选列表

搜索[c 14],共10000篇文章
优秀的个人博客,低调大师

Windows10 VS2017 C++ xml解析(tinyxml2库)

版权声明:本文可能为博主原创文章,若标明出处可随便转载。 https://blog.csdn.net/Jailman/article/details/85264849 首先下载tinyxml2 7.0.1库:https://github.com/leethomason/tinyxml2/releases 打开tinyxml2,然后升级sdk,解决方案->重定解决方案目标,升级。 然后编译生成dll和库文件,在tinyxml2\Debug-Dll下,将tinyxml2.lib和tinyxml2.dll拷贝到新建的工程目录,在新建工程根目录新建include文件夹,将tinyxml2.h拷入,并将工程->配置属性->vc++目录->包含目录指向此目录。 编码: #include "pch.h" #include <iostream> #include <tinyxml2.h> #pragma comment(lib, "tinyxml2.lib") using namespace std; int main() { static const char* xml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" "<entries>" "<entry name=\"My First Post\" age=\"52\">I believe every human has a finite number of heartbeats. I don't intend to waste any of mine</entry>" "<entry name=\"The Second\" age=\"\">You know, being a test pilot isn't always the healthiest business in the world.</entry>" "<entry>Entry</entry>" "<entry name=\"The Third\" secretdata=\"9809832\">We have an infinite amount to learn both from nature and from each other</entry>" "<entry name=\"Final Post...\" hidden=\"true\" age=\"3\">Across the sea of space, the stars are other suns.</entry>" "</entries>"; tinyxml2::XMLDocument doc; doc.Parse(xml); tinyxml2::XMLHandle docHandle(&doc); tinyxml2::XMLElement *entry = docHandle.FirstChildElement("entries").ToElement(); if (entry) { for (tinyxml2::XMLNode *node = entry->FirstChildElement(); node; node = node->NextSibling()) { tinyxml2::XMLElement *e = node->ToElement(); const char *name = e->Attribute("name"); if (name) cout << name << ": "; cout << e->GetText(); int true_age = e->IntAttribute("age") + 50; cout << " " << true_age << endl; } } return 0; } 如果需要单独使用exe,需要注意带上tinyxml2.dll文件 结果显示: 参考文章:https://gist.github.com/felton/5530029

优秀的个人博客,低调大师

Windows10 VS2017 C++ ini解析(使用simpleini头文件)

版权声明:本文可能为博主原创文章,若标明出处可随便转载。 https://blog.csdn.net/Jailman/article/details/85266402 simpleini项目地址:https://github.com/brofield/simpleini 下载,新建项目,并将SimpleIni.h文件通过包含目录的方式加载进来。 创建test.ini文件,内容如下: [server] root = 10.1.1.1 gc = 10.1.1.2 game = 10.1.1.3 写码: #include "pch.h" #include <iostream> #include <SimpleIni.h> using namespace std; int main() { CSimpleIniA ini; ini.SetUnicode(); ini.LoadFile("test.ini"); const char * pVal = ini.GetValue("server", "game", "default"); ini.SetValue("server", "game", "10.1.1.5"); const char * xVal = ini.GetValue("server", "game", "default"); cout << pVal << endl; cout << xVal << endl; // save the data back to the file int rc = ini.SaveFile("test.ini"); if (rc < 0) return false; } 打开test.ini文件会发现game一行内容改变。

优秀的个人博客,低调大师

java B2B2C Springboot多租户电子商城系统

大型企业分布式互联网电子商务平台技术列表 愿意了解源码的朋友直接企鹅求求:二一四七七七五六三三 技术列表: Spring Cloud Config配置管理工具包,让你可以把配置放到远程服务器,集中化管理集群配置,目前支持本地存储、Git以及Subversion Spring Cloud Bus事件、消息总线,用于在集群(例如,配置变化事件)中传播状态变化,可与Spring Cloud Config联合实现热部署 Eureka云端服务发现,一个基于 REST 的服务,用于定位服务,以实现云端中间层服务发现和故障转移。 Hystrix熔断器,容错管理工具,旨在通过熔断机制控制服务和第三方库的节点,从而对延迟和故障提供更强大的容错能力。 ZuulZuul 是在云平台上提供动态路由,监控,弹性,安全等边缘服务的框架。Zuul 相当于是设备和 Netflix 流应用的 Web 网站后端所有请求的前门。 Spring Cloud Security基于spring security的安全工具包,为你的应用程序添加安全控制。 FeignFeign是一种声明式、模板化的HTTP客户端。 通用架构: springmvc,spring boot,spring security,Oauth2.0,mybatis,mybatis plus 、kafka、zookeepre 前端框架:Bootstrap 4 、html5、css3 扁平化风格 技术架构图:资料和源码来源

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

用户登录
用户注册
修改密码
忘记密码