1
TiXmlElement * book = new TiXmlElement("book");
root->LinkEndChild(book);
string str1="name";
const string str2=catalog[i].id();
book->SetAttribute(str1,str2);
我得到這樣的錯誤 [錯誤]用於調用 'TiXmlElement ::的setAttribute(的std :: string &,常量字符串&)' 不匹配函數不能在傳遞的setAttribute串
我需要無論如何設置屬性。
任何你沒有做的原因'TiXmlElement book(「book」);'? – chris