TiXmlElement *pElem;
std::string StatusResponse;
pElem = hResponse.FirstChild("StatusResponse").Element();
if (pElem)
StatusResponse = pElem->GetText();
如果pElem
有效但元素不包含文本,则pElem->GetText()
返回 NULL 指针,导致异常。我该如何处理?
谢谢。
TiXmlElement *pElem;
std::string StatusResponse;
pElem = hResponse.FirstChild("StatusResponse").Element();
if (pElem)
StatusResponse = pElem->GetText();
如果pElem
有效但元素不包含文本,则pElem->GetText()
返回 NULL 指针,导致异常。我该如何处理?
谢谢。