Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下xml:
xml:
<Name /> <Sur> mmm </Sur>
当我反序列化时,我写道:
TiXmlElement* section; section=handle.FirstChild("Name").ToElement() if (section) {}
问题是 if 条件虽然运行field Name is null。为什么?我哪里错了?欣赏。谢谢
field Name is null
也许您应该定义 XML 代码的根元素,例如<Person>:
<Person>
<Person> <Name /> <Sur> mmm <Sur /> </Person>