如何在C/C ++中读取/写入Xml文件? [英] How to read/write Xml File in C/C++?

查看:132
本文介绍了如何在C/C ++中读取/写入Xml文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道如何用纯C ++或C读写Xml文件.
我不能使用任何.Net库,而在Visual Studio 2010中使用空白的Win32 C ++项目.
如果可能的话,我不想使用任何第三方工具/代码. .com/en-us/library/windows/desktop/ms763742(v = vs.85).aspx> MSXML [


I need to know how to read and write Xml files in pure C++ or C.
I can''t use any .Net libraries and I''m using a blank Win32 C++ Project in Visual Studio 2010.
If possible I''d like to not use any 3rd party tools/code.

Have a look at MSXML[^]

The header file is included with the Windows SDK:

#include <MsXml.h>



Best regards
Espen Harlinn


If you don''t need xml validation (dtd, xsl, ...), xml namespaces and similar fancy stuff I would recommend using tinyxml that is hassle free to put into a c++ program and is platform independent.(we use it on win32, linux, android, iOS, ...). Its a very popular "simple drop-in" library.


这篇关于如何在C/C ++中读取/写入Xml文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆