I researched a lot on how to read and write ( update ) a simple .xml file in C++ but i am not able to develop the code for it.
I work and installed xerces-c library that I think is needed to use DOM or SAX2 parser to read it.
Please someone can help to write the code for it.
A sample code to do this will be quite helpful.
Thanks & best Regards, Adarsh Sharma
Boost serializer can do the trick, if you pass an object to it, it write a file (binary or xml or even a simple text file) with all the class properties.
I recommend MSXML. It may look complicated, but it's nice and easy when you get used to it.
Here's a sample:
input.xml:
code:
output: XML was successfully loaded Car has 4 wheels output.xml successfully saved
output.xml:
You will find everything you need here:
http://msdn.microsoft.com/en-us/library/ms765540(v=vs.85).aspx
Hope someone finds this useful ;)