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.
精彩评论