C++ —— Tinyxml2在Vs2017下相关使用2(较文1更复杂,附源码)

news2024/9/20 9:42:35
相关链接

C++ —— Tinyxml2在Vs2017下相关使用1(附源码)

tinyxml2简介

     TinyXML2是一个简单,小巧,高效,C++XML解析器,可以很容易地集成到其他程序中。TinyXML-2解析一个XML文档,并从中构建一个 可以读取、修改和保存的文档对象模型 (DOM)。XML代表“可扩展标记语言”。这是一个通用目的 用于描述任意数据的人类和机器可读标记语言。 为存储应用程序数据而创建的所有随机文件格式都可以 全部替换为 XML。一个解析器可以解决所有问题。

源码下载

     Github - Tinyxml2源码下载地址

     一般来说,下载源码后无需编译仅将其中的tinyxml2.cpp、tinyxml2.h包含在自己的项目中就可以使用了。
     (若需构建库使用CMake构建源码,然后利用Vs仅编译tinyxml2项目。)

使用tinyxml2注意事项

     TinyXML与实体

TinyXML认得预定义的特殊“字符实体”,即:
	& &
	< <
	> >
	" "
	&apos; ‘
这些在XML文档读取时都会被辨认出来,并会被转化成等价的UTF-8字符。

代码写入xml
<?xml version="1.0" encoding="UTF-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <ItemGroup Label="ProjectConfigurations">
        <ProjectConfigurations Include="Debug|X64">
            <Configuration>Debug</Configuration>
            <Platform>x64</Platform>
        </ProjectConfigurations>
        <ProjectConfiguration Include="Release|X64">
            <Configuration>Release</Configuration>
            <Platform>x64</Platform>
        </ProjectConfiguration>
    </ItemGroup>
    <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
    <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
    <ImportGroup Condition="Exists(&apos;$(QtMsBuild)\qt_defaults.props&apos;)">
        <Import Project="$(QtMsBuild)\qt_defaults.props"/>
    </ImportGroup>
    <PropertyGroup Condition="&apos;$(Configuration)|$(Platform)&apos; == &apos;Debug|x64&apos;" Label="QtSettings">
        <QtInstall>5.12.4(64)</QtInstall>
        <QtModules>core;gui;widgets;network;</QtModules>
        <QtBuildConfig>debug</QtBuildConfig>
    </PropertyGroup>
    <Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists(&apos;$(QtMsBuild)\qt.targets&apos;) or !Exists(&apos;$(QtMsBuild)\qt.props&apos;)">
        <Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly."/>
    </Target>
    <ImportGroup Label="ExtensionSettings"/>
    <ImportGroup Label="Shared"/>
    <ImportGroup Label="PropertySheets" Condition="&apos;$(Configuration)|$(Platform)&apos; == &apos;Debug|x64&apos;">
        <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists(&apos;$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props&apos;)" Label="LocalAppDataPlatform"/>
        <Import Project="$(QtMsBuild)\Qt.props"/>
    </ImportGroup>
    <ItemDefinitionGroup Condition="&apos;$(Configuration)|$(Platform)&apos; == &apos;Release|x64&apos;" Label="Configuration">
        <ClCompile>
            <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
            <MultiProcessorCompilation>true</MultiProcessorCompilation>
            <DebugInformationFormat>None</DebugInformationFormat>
            <Optimization>MaxSpeed</Optimization>
        </ClCompile>
        <Link>
            <SubSystem>Console</SubSystem>
            <GenerateDebugInformation>false</GenerateDebugInformation>
        </Link>
    </ItemDefinitionGroup>
</Project>
#include <iostream>
#include "tinyxml/tinyxml2.h"

int main()
{
#if 0 // 写入
	tinyxml2::XMLDocument xml;
	xml.Parse("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
	tinyxml2::XMLElement* rootNode = xml.NewElement("Project");
	rootNode->SetAttribute("DefaultTargets", "Build");
	rootNode->SetAttribute("ToolsVersion", "15.0");
	rootNode->SetAttribute("xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");
	xml.InsertEndChild(rootNode);
	{
		tinyxml2::XMLElement *element_ItemGroup = xml.NewElement("ItemGroup");
		element_ItemGroup->SetAttribute("Label", "ProjectConfigurations");
		rootNode->InsertEndChild(element_ItemGroup);
		{
			tinyxml2::XMLElement *element_ProjectConfiguration = xml.NewElement("ProjectConfigurations");
			element_ProjectConfiguration->SetAttribute("Include", "Debug|X64");
			element_ItemGroup->InsertEndChild(element_ProjectConfiguration);
			{
				tinyxml2::XMLElement *element_ProjectConfiguration_Configuration = xml.NewElement("Configuration");
				element_ProjectConfiguration_Configuration->InsertNewText("Debug");
				element_ProjectConfiguration->InsertEndChild(element_ProjectConfiguration_Configuration);
			}
			{
				tinyxml2::XMLElement *element_ProjectConfiguration_Platform = xml.NewElement("Platform");
				element_ProjectConfiguration_Platform->InsertNewText("x64");
				element_ProjectConfiguration->InsertEndChild(element_ProjectConfiguration_Platform);
			}
		}
		{
			tinyxml2::XMLElement *element_ProjectConfiguration = xml.NewElement("ProjectConfiguration");
			element_ProjectConfiguration->SetAttribute("Include", "Release|X64");
			element_ItemGroup->InsertEndChild(element_ProjectConfiguration);
			{			
				tinyxml2::XMLElement *element_ProjectConfiguration_Configuration = xml.NewElement("Configuration");
				element_ProjectConfiguration_Configuration->InsertNewText("Release");
				element_ProjectConfiguration->InsertEndChild(element_ProjectConfiguration_Configuration);
			}
			{
				tinyxml2::XMLElement *element_ProjectConfiguration_Platform = xml.NewElement("Platform");
				element_ProjectConfiguration_Platform->InsertNewText("x64");
				element_ProjectConfiguration->InsertEndChild(element_ProjectConfiguration_Platform);
			}
		}
	}

	{
		tinyxml2::XMLElement *element_Import = xml.NewElement("Import");
		element_Import->SetAttribute("Project", "$(VCTargetsPath)\\Microsoft.Cpp.Default.props");
		rootNode->InsertEndChild(element_Import);
	}

	{
		tinyxml2::XMLElement *element_Import = xml.NewElement("Import");
		element_Import->SetAttribute("Project", "$(VCTargetsPath)\\Microsoft.Cpp.props");
		rootNode->InsertEndChild(element_Import);
	}

	{
		tinyxml2::XMLElement *element_ImportGroup = xml.NewElement("ImportGroup");
		element_ImportGroup->SetAttribute("Condition", "Exists('$(QtMsBuild)\\qt_defaults.props')");
		{
			tinyxml2::XMLElement *element_Import = xml.NewElement("Import");
			element_Import->SetAttribute("Project", "$(QtMsBuild)\\qt_defaults.props");
			element_ImportGroup->InsertEndChild(element_Import);
		}
		rootNode->InsertEndChild(element_ImportGroup);
	}

	{
		tinyxml2::XMLElement *element_PropertyGroup = xml.NewElement("PropertyGroup");
		element_PropertyGroup->SetAttribute("Condition", "'$(Configuration)|$(Platform)' == 'Debug|x64'");
		element_PropertyGroup->SetAttribute("Label", "QtSettings");
		{
			{
				tinyxml2::XMLElement *element_QtInstall = xml.NewElement("QtInstall");
				element_QtInstall->InsertNewText("5.12.4(64)");
				element_PropertyGroup->InsertEndChild(element_QtInstall);
			}
			{
				tinyxml2::XMLElement *element_QtModules = xml.NewElement("QtModules");
				element_QtModules->InsertNewText("core;gui;widgets;network;");
				element_PropertyGroup->InsertEndChild(element_QtModules);
			}
			{
				tinyxml2::XMLElement *element_QtBuildConfig = xml.NewElement("QtBuildConfig");
				element_QtBuildConfig->InsertNewText("debug");
				element_PropertyGroup->InsertEndChild(element_QtBuildConfig);
			}
		}
		rootNode->InsertEndChild(element_PropertyGroup);
	}

	{
		tinyxml2::XMLElement *element_Target = xml.NewElement("Target");
		element_Target->SetAttribute("Name", "QtMsBuildNotFound");
		element_Target->SetAttribute("BeforeTargets", "CustomBuild;ClCompile");
		element_Target->SetAttribute("Condition", "!Exists('$(QtMsBuild)\\qt.targets') or !Exists('$(QtMsBuild)\\qt.props')");
		{
			tinyxml2::XMLElement *element_Message = xml.NewElement("Message");
			element_Message->SetAttribute("Importance", "High");
			element_Message->SetAttribute("Text", "QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly.");
			element_Target->InsertEndChild(element_Message);
		}
		rootNode->InsertEndChild(element_Target);
	}

	{
		tinyxml2::XMLElement *element_ImportGroup = xml.NewElement("ImportGroup");
		element_ImportGroup->SetAttribute("Label", "ExtensionSettings");
		rootNode->InsertEndChild(element_ImportGroup);
	}

	{
		tinyxml2::XMLElement *element_ImportGroup = xml.NewElement("ImportGroup");
		element_ImportGroup->SetAttribute("Label", "Shared");
		rootNode->InsertEndChild(element_ImportGroup);
	}

	{
		tinyxml2::XMLElement *element_ImportGroup = xml.NewElement("ImportGroup");
		element_ImportGroup->SetAttribute("Label", "PropertySheets");
		element_ImportGroup->SetAttribute("Condition", "'$(Configuration)|$(Platform)' == 'Debug|x64'");
		rootNode->InsertEndChild(element_ImportGroup);
		{
			tinyxml2::XMLElement *element_Import = xml.NewElement("Import");
			element_Import->SetAttribute("Project", "$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props");
			element_Import->SetAttribute("Condition", "exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')");
			element_Import->SetAttribute("Label", "LocalAppDataPlatform");
			element_ImportGroup->InsertEndChild(element_Import);
		}
		{
			tinyxml2::XMLElement *element_Import = xml.NewElement("Import");
			element_Import->SetAttribute("Project", "$(QtMsBuild)\\Qt.props");
			element_ImportGroup->InsertEndChild(element_Import);
		}
	}

	{
		tinyxml2::XMLElement *element_ItemDefinitionGroup = xml.NewElement("ItemDefinitionGroup");
		element_ItemDefinitionGroup->SetAttribute("Condition", "'$(Configuration)|$(Platform)' == 'Release|x64'");
		element_ItemDefinitionGroup->SetAttribute("Label", "Configuration");
		{
			{
				tinyxml2::XMLElement *element_ClCompile = xml.NewElement("ClCompile");
				element_ItemDefinitionGroup->InsertEndChild(element_ClCompile);
				{
					tinyxml2::XMLElement *element_TreatWChar_tAsBuiltInType = xml.NewElement("TreatWChar_tAsBuiltInType");
					element_TreatWChar_tAsBuiltInType->InsertNewText("true");
					element_ClCompile->InsertEndChild(element_TreatWChar_tAsBuiltInType);
				}
				{
					tinyxml2::XMLElement *element_TreatWChar_MultiProcessorCompilation = xml.NewElement("MultiProcessorCompilation");
					element_TreatWChar_MultiProcessorCompilation->InsertNewText("true");
					element_ClCompile->InsertEndChild(element_TreatWChar_MultiProcessorCompilation);
				}
				{
					tinyxml2::XMLElement *element_DebugInformationFormat = xml.NewElement("DebugInformationFormat");
					element_DebugInformationFormat->InsertNewText("None");
					element_ClCompile->InsertEndChild(element_DebugInformationFormat);
				}
				{
					tinyxml2::XMLElement *element_Optimization = xml.NewElement("Optimization");
					element_Optimization->InsertNewText("MaxSpeed");
					element_ClCompile->InsertEndChild(element_Optimization);
				}
			}
			{
				tinyxml2::XMLElement *element_Link = xml.NewElement("Link");
				element_ItemDefinitionGroup->InsertEndChild(element_Link);
				{
					tinyxml2::XMLElement *element_SubSystem = xml.NewElement("SubSystem");
					element_SubSystem->InsertNewText("Console");
					element_Link->InsertEndChild(element_SubSystem);
				}
				{
					tinyxml2::XMLElement *element_GenerateDebugInformation = xml.NewElement("GenerateDebugInformation");
					element_GenerateDebugInformation->InsertNewText("false");
					element_Link->InsertEndChild(element_GenerateDebugInformation);
				}
			}
		}
		rootNode->InsertEndChild(element_ItemDefinitionGroup);
	}

	xml.SaveFile("./temp_behaviac.xml");
	xml.Clear();
	system("pause");
	return 0;
}

代码读取xml

在这里插入图片描述

int main()
{
	tinyxml2::XMLDocument xml;
	tinyxml2::XMLError errXml = xml.LoadFile("./temp_behaviac.xml");
	if (tinyxml2::XML_SUCCESS == errXml)
	{
		tinyxml2::XMLElement* root = xml.RootElement();
		if (root)
		{
			std::cout << root->Value()
				<< " DefaultTargets=" << root->Attribute("DefaultTargets")
				<< " ToolsVersion=" << root->Attribute("ToolsVersion")
				<< " xmlns=" << root->Attribute("xmlns") << std::endl;

			tinyxml2::XMLElement *XMLElement_ItemGroup = root->FirstChildElement();
			if (XMLElement_ItemGroup)
			{
				std::cout << "\t" << XMLElement_ItemGroup->Value() << " Label=" << XMLElement_ItemGroup->Attribute("Label") << std::endl;
				{
					tinyxml2::XMLElement *XMLElement_ProjectConfigurations = XMLElement_ItemGroup->FirstChildElement();
					if (!XMLElement_ProjectConfigurations) { return -1; }
					std::cout << "\t\t" << XMLElement_ProjectConfigurations->Value() << " Include=" << XMLElement_ProjectConfigurations->Attribute("Include") << std::endl;
					{
						tinyxml2::XMLElement *XMLElement_Configuration = XMLElement_ProjectConfigurations->FirstChildElement();
						if (!XMLElement_Configuration) { return -1; }
						std::cout << "\t\t\t" << XMLElement_Configuration->Value() << " " << XMLElement_Configuration->GetText() << std::endl;

						tinyxml2::XMLElement *XMLElement_Platform = XMLElement_Configuration->NextSiblingElement();
						if (!XMLElement_Platform) { return -1; }
						std::cout << "\t\t\t" << XMLElement_Platform->Value() << " " << XMLElement_Platform->GetText() << std::endl;
					}

					tinyxml2::XMLElement *XMLElement_ProjectConfiguration = XMLElement_ProjectConfigurations->NextSiblingElement();
					if (!XMLElement_ProjectConfiguration) { return -1; }
					std::cout << "\t\t" << XMLElement_ProjectConfiguration->Value() << " Include=" << XMLElement_ProjectConfiguration->Attribute("Include") << std::endl;
					{
						tinyxml2::XMLElement *XMLElement_Configuration = XMLElement_ProjectConfiguration->FirstChildElement();
						if (!XMLElement_Configuration) { return -1; }
						std::cout << "\t\t\t" << XMLElement_Configuration->Value() << " " << XMLElement_Configuration->GetText() << std::endl;

						tinyxml2::XMLElement *XMLElement_Platform = XMLElement_Configuration->NextSiblingElement();
						if (!XMLElement_Platform) { return -1; }
						std::cout << "\t\t\t" << XMLElement_Platform->Value() << " " << XMLElement_Platform->GetText() << std::endl;
					}
				}

				tinyxml2::XMLElement *XMLElement_Import = XMLElement_ItemGroup->NextSiblingElement();
				if (!XMLElement_Import) { return -1; }
				std::cout << "\t" << XMLElement_Import->Value() << " Project=" << XMLElement_Import->Attribute("Project") << std::endl;

				tinyxml2::XMLElement *XMLElement_Import2 = XMLElement_Import->NextSiblingElement();
				if (!XMLElement_Import2) { return -1; }
				std::cout << "\t" << XMLElement_Import2->Value() << " Project=" << XMLElement_Import2->Attribute("Project") << std::endl;

				tinyxml2::XMLElement *XMLElement_ImportGroup = XMLElement_Import2->NextSiblingElement();
				if (!XMLElement_ImportGroup) { return -1; }
				std::cout << "\t" << XMLElement_ImportGroup->Value() << " Condition=" << XMLElement_ImportGroup->Attribute("Condition") << std::endl;
				{
					tinyxml2::XMLElement *XMLElement_Import = XMLElement_ImportGroup->FirstChildElement();
					if (!XMLElement_Import) { return -1; }
					std::cout << "\t\t" << XMLElement_Import->Value() << " Project=" << XMLElement_Import->Attribute("Project") << std::endl;
				}

				tinyxml2::XMLElement *XMLElement_PropertyGroup = XMLElement_ImportGroup->NextSiblingElement();
				if (!XMLElement_PropertyGroup) { return -1; }
				std::cout << "\t" << XMLElement_PropertyGroup->Value() << " Condition=" << XMLElement_PropertyGroup->Attribute("Condition") << " Label=" << XMLElement_PropertyGroup->Attribute("Label") << std::endl;
				{
					tinyxml2::XMLElement *XMLElement_QtInstall = XMLElement_PropertyGroup->FirstChildElement();
					if (!XMLElement_QtInstall) { return -1; }
					std::cout << "\t\t" << XMLElement_QtInstall->Value() << " " << XMLElement_QtInstall->GetText() << std::endl;

					tinyxml2::XMLElement *XMLElement_QtModules = XMLElement_QtInstall->NextSiblingElement();
					if (!XMLElement_QtModules) { return -1; }
					std::cout << "\t\t" << XMLElement_QtModules->Value() << " " << XMLElement_QtModules->GetText() << std::endl;

					tinyxml2::XMLElement *XMLElement_QtBuildConfig = XMLElement_QtModules->NextSiblingElement();
					if (!XMLElement_QtBuildConfig) { return -1; }
					std::cout << "\t\t" << XMLElement_QtBuildConfig->Value() << " " << XMLElement_QtBuildConfig->GetText() << std::endl;
				}

				tinyxml2::XMLElement *XMLElement_Target = XMLElement_PropertyGroup->NextSiblingElement();
				if (!XMLElement_Target) { return -1; }
				std::cout << "\t" << XMLElement_Target->Value() << " Name=" << XMLElement_Target->Attribute("Name") << " BeforeTargets=" << XMLElement_Target->Attribute("BeforeTargets") << " Condition=" << XMLElement_Target->Attribute("Condition") << std::endl;
				{
					tinyxml2::XMLElement *XMLElement_Message = XMLElement_Target->FirstChildElement();
					if (!XMLElement_Message) { return -1; }
					std::cout << "\t\t" << XMLElement_Message->Value() << " Importance=" << XMLElement_Message->Attribute("Importance") << " Text=" << XMLElement_Message->Attribute("Text") << std::endl;
				}

				tinyxml2::XMLElement *XMLElement_ImportGroup1 = XMLElement_Target->NextSiblingElement();
				if (!XMLElement_ImportGroup1) { return -1; }
				std::cout << "\t" << XMLElement_ImportGroup1->Value() << " Label=" << XMLElement_ImportGroup1->Attribute("Label") << std::endl;

				tinyxml2::XMLElement *XMLElement_ImportGroup2 = XMLElement_ImportGroup1->NextSiblingElement();
				if (!XMLElement_ImportGroup2) { return -1; }
				std::cout << "\t" << XMLElement_ImportGroup2->Value() << " Label=" << XMLElement_ImportGroup2->Attribute("Label") << std::endl;

				tinyxml2::XMLElement *XMLElement_ImportGroup3 = XMLElement_ImportGroup2->NextSiblingElement();
				if (!XMLElement_ImportGroup3) { return -1; }
				std::cout << "\t" << XMLElement_ImportGroup3->Value() << " Label=" << XMLElement_ImportGroup3->Attribute("Label") << " Condition=" << XMLElement_ImportGroup3->Attribute("Condition") << std::endl;
				{
					tinyxml2::XMLElement *XMLElement_Import = XMLElement_ImportGroup3->FirstChildElement();
					if (!XMLElement_Import) { return -1; }
					std::cout << "\t\t" << XMLElement_Import->Value() << " Project=" << XMLElement_Import->Attribute("Project") << " Condition=" << XMLElement_Import->Attribute("Condition") << " Label=" << XMLElement_Import->Attribute("Label") << std::endl;

					tinyxml2::XMLElement *XMLElement_Import2 = XMLElement_Import->NextSiblingElement();
					if (!XMLElement_Import2) { return -1; }
					std::cout << "\t\t" << XMLElement_Import2->Value() << " Project=" << XMLElement_Import2->Attribute("Project") << std::endl;
				}

				tinyxml2::XMLElement *XMLElement_ItemDefinitionGroup = XMLElement_ImportGroup3->NextSiblingElement();
				if (!XMLElement_ItemDefinitionGroup) { return -1; }
				std::cout << "\t" << XMLElement_ItemDefinitionGroup->Value() << " Condition=" << XMLElement_ItemDefinitionGroup->Attribute("Condition") << " Label=" << XMLElement_ItemDefinitionGroup->Attribute("Label") << std::endl;
				{
					tinyxml2::XMLElement *XMLElement_ClCompile = XMLElement_ItemDefinitionGroup->FirstChildElement();
					if (!XMLElement_ClCompile) { return -1; }
					std::cout << "\t" << XMLElement_ClCompile->Value() << std::endl;
					{
						tinyxml2::XMLElement *XMLElement_TreatWChar_tAsBuiltInType = XMLElement_ClCompile->FirstChildElement();
						if (!XMLElement_TreatWChar_tAsBuiltInType) { return -1; }
						std::cout << "\t\t" << XMLElement_TreatWChar_tAsBuiltInType->Value() << " " << XMLElement_TreatWChar_tAsBuiltInType->GetText() << std::endl;

						tinyxml2::XMLElement *XMLElement_MultiProcessorCompilation = XMLElement_TreatWChar_tAsBuiltInType->NextSiblingElement();
						if (!XMLElement_MultiProcessorCompilation) { return -1; }
						std::cout << "\t\t" << XMLElement_MultiProcessorCompilation->Value() << " " << XMLElement_MultiProcessorCompilation->GetText() << std::endl;

						tinyxml2::XMLElement *XMLElement_DebugInformationFormat = XMLElement_MultiProcessorCompilation->NextSiblingElement();
						if (!XMLElement_DebugInformationFormat) { return -1; }
						std::cout << "\t\t" << XMLElement_DebugInformationFormat->Value() << " " << XMLElement_DebugInformationFormat->GetText() << std::endl;

						tinyxml2::XMLElement *XMLElement_Optimization = XMLElement_DebugInformationFormat->NextSiblingElement();
						if (!XMLElement_Optimization) { return -1; }
						std::cout << "\t\t" << XMLElement_Optimization->Value() << " " << XMLElement_Optimization->GetText() << std::endl;
					}

					tinyxml2::XMLElement *XMLElement_Link = XMLElement_ClCompile->NextSiblingElement();
					if (!XMLElement_Link) { return -1; }
					std::cout << "\t" << XMLElement_Link->Value() << std::endl;
					{
						tinyxml2::XMLElement *XMLElement_SubSystem = XMLElement_Link->FirstChildElement();
						if (!XMLElement_SubSystem) { return -1; }
						std::cout << "\t\t" << XMLElement_SubSystem->Value() << " " << XMLElement_SubSystem->GetText() << std::endl;

						tinyxml2::XMLElement *XMLElement_GenerateDebugInformation = XMLElement_SubSystem->NextSiblingElement();
						if (!XMLElement_GenerateDebugInformation) { return -1; }
						std::cout << "\t\t" << XMLElement_GenerateDebugInformation->Value() << " " << XMLElement_GenerateDebugInformation->GetText() << std::endl;
					}
				}
			}
		}
		root = nullptr;
	}
	system("pause");
	return 0;
}

笔者

笔者 - jxd

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1100776.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

强化学习章节脉络

强化学习是在求解最优策略

Python爬虫:制作一个属于自己的IP代理模块

前言 在Python爬虫过程中&#xff0c;为了避免被网站的反爬虫机制干扰&#xff0c;我们需要使用IP代理。所谓IP代理&#xff0c;就是通过修改网络请求中的IP地址&#xff0c;来达到隐藏真实IP地址的效果。本文将教你如何制作一个自己的IP代理模块&#xff0c;让你的爬虫更加稳…

网络库OKHttp(1)流程

序、慢慢来才是最快的方法。 背景 OkHttp 是一套处理 HTTP 网络请求的依赖库&#xff0c;由 Square 公司设计研发并开源&#xff0c;目前可以在 Java 和 Kotlin 中使用。对于 Android App 来说&#xff0c;OkHttp 现在几乎已经占据了所有的网络请求操作。 OKHttp源码官网 版…

8.14 PowerBI系列之DAX函数专题-分析客户购买行为

需求 实现 其实如果同时输出订单号的情况下&#xff0c;可以通过订单号出现的次数判断同一订单中同时购买与否的关系。 同时购买了A和B的客户 var v_cust_1 calculatetable(values(客户表[客户姓名]),filter(订单表,订单表[产品编号] "off-pa-10001970")) var v…

2016款奔驰C200车COMAND显示屏黑屏

作者&#xff1a;中鑫之宝鹤壁店 赵玉宾 赵玉宾&#xff0c;从事汽车维修工作9年&#xff0c;现任中鑫之宝汽车服务有限公司鹤壁分公司高级维修技师。 故障现象 一辆2016款奔驰C200车&#xff0c;搭载274发动机&#xff0c;累计行驶里程约为7万km。车主反映&#xff0c;车辆行…

亚马逊、eBay,速卖通,国际站买家账号支付异常问题解决方法

如何解决下单被砍、封号问题&#xff0c;建议采取以下措施&#xff1a; 买家账号下单&#xff0c;不单纯只是解决支付卡、IP问题就可以了&#xff0c;因为平台大数据风控点很多&#xff0c; 我们防关联具体要解决几个问题 一&#xff1a;要硬件参数的关联、安全码、地区码、…

【定时开关机】windows 10 如何设置定时开关机

一、需求 二、场景 三、思路 四、实现 A. 设置来电开机 B. 设置及定时关机 一、需求 需要一台 win 10 的电脑在工作时间内自动开关机&#xff08;早 8:30 - 晚&#xff1a;6:05&#xff09; 二、场景 开机&#xff1a;早 8:30 关机&#xff1a;晚 6:05 三、思路 【开机…

github 终端克隆操作,以及对 https/ssh 的理解

前言 最近瞎搞 github 的一些配置&#xff0c;结果搞得有一段时间克隆不了仓库。不过经历了这次风波后&#xff0c;我对 github 的一些原理有了更清楚的了解。所以想稍微写一小篇文章总结输出一下&#xff0c;也欢迎有疑问的读者与博主进一步交流&#xff0c;我的理解还是有限…

2023年中国钢卷尺产量、销量、市场均价及市场规模分析[图]

卷尺是日常生活中常用的工量具&#xff0c;是家庭必备工具之一。鲁班尺、风水尺、文公尺同样属于钢卷尺。钢卷尺是建筑和装修常用工具。钢卷尺可分为&#xff0c;自卷式卷尺、制动式卷尺、摇卷式卷尺。钢卷尺的其他名称有&#xff1a;钢皮卷尺、钢盒尺。 钢卷尺市场已经告别了以…

什么是库存管理?无需Excel,2023年这几款大热库存管理软件你get了吗?

什么是库存管理&#xff1f;库存管理是什么意思&#xff1f;都有哪些好用的库存管理系统&#xff1f;相信这些都是大家非常关注的话题&#xff0c;这篇就跟大家详细唠唠什么是库存管理&#xff0c;都用什么系统可以进行库存管理&#xff0c;并且为大家盘点2023年这几款大热库存…

和硕首次参加展OCP 峰会,将发布多项AI合作项目产品 | 百能云芯

电子代工大厂和硕联合科技宣布&#xff0c;将参与今年的 OCP 全球峰会 (OCP Global Summit)&#xff0c;展示与英伟达 (NVIDIA) 合作成果&#xff0c;包含使用英伟达 GH200 Grace Hopper 超级芯片的 MGX AI 服务器&#xff0c;以及搭载 A100、L40 等服务器产品。 OCP 峰会于 10…

斯坦福JSKarel编程机器人使用介绍

斯坦福JSKarel编程机器人使用介绍 为了避免被编程语言固有的复杂性所困扰&#xff0c;有一个被称为卡雷尔&#xff08;Karel&#xff09;机器人的微型世界&#xff08;microworld&#xff09;的简化环境&#xff0c;可以让编程初学者从中学习理解编程的基本概念&#xff0c;而…

GaussDB for openGauss部署形态

前言 华为云数据库GaussDB是华为自主创新研发的分布式关系型数据库&#xff0c;具有高性能、高可用、高安全、低成本的特点&#xff0c;本文带你详细了解GaussDB数据库的部署形态。 1、GaussDB部署形态三种类型 GaussDB部署形态&#xff1a;单机 独立部署是将数据库组件部署…

10.17课上(七段显示器,递归异或与电路)

异或的递归与数电实现 用二选一选择器实现异或函数 在异或当中&#xff0c;如果有一项为0&#xff0c;就可以把那一项消掉&#xff1b;如果有一项为1&#xff0c;就是把剩下的所有项运算完的结果取反 &#xff08;由此在算法当中可以采用递归解决&#xff09; 当w1为0时&…

电脑蓝牙与ESP32蓝牙连接,让电脑发现ESP32

win11蓝牙默认只查看常见蓝牙设备。ESP32创建的蓝牙很有可能是看不到的。 再蓝牙设备发现一栏选择高级&#xff0c;才能查看所有蓝牙设备。 只要下面几行代码&#xff0c;就能让PC发现ESP32 #include <BLEDevice.h> // 引入相关库void setup() {BLEDevice::init("…

使用 PDB Alignment Tool 对 PDB 中多个蛋白结构进行比对

0. 说明&#xff1a; 利用 PDB 提供的在线工具 PDB Alignment Tool (https://www.rcsb.org/alignment) 对 PDB 中多个蛋白进行结构比对&#xff0c;并将比对结果输出&#xff0c;用于后续计算不同链上氨基酸之间的距离。 1. 步骤&#xff08;以 3GBM_A, 3FKU_A 和 2FK0_A 为例…

Linux学习——进程状态

目录 一&#xff0c;进程状态 1&#xff0c;进程状态的分类 2.状态的本质 3.进程状态详解 1.运行状态 2.阻塞状态 3.挂起状态 4.Linux内核中的状态分类 一&#xff0c;进程状态 1&#xff0c;进程状态的分类 如下图&#xff1a; 在计算机中我们的状态的分类便如下图所示…

16-k8s-configMap配置管理中心

文章目录 一、相关概念二、基于目录创建configMap三、基于文件创建configMap四、基于自定义参数创建configMap五、configMap使用六、configMap热更新 一、相关概念 简介 为了解决传统容器中配置的挂载、变更、管理等问题&#xff0c;在k8s中引入了一个叫做configmap的资源对象&…

采用医疗AI、自然语言处理技术的java智能导诊导医系统源码

一套java智能导诊导医系统源码&#xff08;演示自主版权商业项目应用&#xff09; 随着人工智能技术的快速发展&#xff0c;语音识别与自然语言理解技术的成熟应用&#xff0c;基于人工智能的智能导诊导医逐渐出现在患者的生活视角中&#xff0c;智能导诊系统应用到医院就医场景…

同为科技TOWE智能PDU引领数据中心机房远控用电安全高效

随着数据中心的环境变得更加动态和复杂&#xff0c;许多数据中心都在对数据中心管理人员施加压力&#xff0c;要求提高可用性&#xff0c;同时降低成本&#xff0c;提升效率。新一代高密度服务器和网络设备的投入使用&#xff0c;增加了对更高密度机架的需求&#xff0c;并对整…