开发者

writing xml files [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. 开发者_如何学Python Closed 11 years ago.

Suppose I want to write files and store them as xml files. How do I do that? I've never dealt with xml files before and I was wondering how you'd do that and if you have any useful comments on where to start!

Thanks in advance


If you mean writing XML to a file, Just write it!

#include <iostream>
#include <fstream>
using namespace std;

int main () {
  ofstream myfile;
  myfile.open ("test.xml");
  myfile << "<?xml version=\"1.0\" encoding=\"utf-8\"?><book></book>";
  myfile.close();
  return 0;
}


The simple way to write/read XML files on Windows is to use XmlLite parser:

"Small And Fast XML Parser For Native C++"

You also have working samples from MSDN.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜