我寫的函數有點問題,求指導:
解析庫用的tinyxml2:
http://grinninglizard.com/tinyxml2docs/index.html
[code=c][/void findAllLabel(XMLElement* next)
{
if(next->FirstChildElement("Question"))
{
next = next->FirstChildElement("Question");
string str = next->FirstChildElement("Label")->GetText();
cout<<str<<endl;
}
else
{
XMLElement *neighbor = next->NextSiblingElement();
while(neighbor)
{
string str1 = neighbor->FirstChildElement("Label")->GetText();
cout<<str1<<endl;
neighbor = neighbor->NextSiblingElement();
}
next =
}
//XMLElement* nextElement = next->FirstChildElement("Question");
findAllLabel(next);
}[code]
更多
0
帖子:
http://bbs.csdn.net/topics/391036566?page=1#post-399218919