开发者

Create an xml from an object [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

c++ linux library for creating an xml and reading from an xml (serialize/ deserialize)

HI, I am working in Ubuntu. I would like to create an xml from am object I have t开发者_运维技巧his:

Class me
{
    std::tring name;
    int age;
};

main()

me *p = new me();

p->age=12;
p->name="dina";

How can I create an xml. I would like to have

<data>
    <name>p->name</name>
    <age>p->age</age>
</data>


You should look at TinyXml; it allows a Document Object Model (DOM) to be constructed with your object attributes and then saved to file.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜