Smu*_*f64 1 c++ xml tinyxml null-pointer
TiXmlElement *pElem;
std::string StatusResponse;
pElem = hResponse.FirstChild("StatusResponse").Element();
if (pElem)
StatusResponse = pElem->GetText();
Run Code Online (Sandbox Code Playgroud)
如果pElem有效但元素不包含文本,则pElem->GetText()返回NULL指针,从而导致异常.我该怎么处理?
谢谢.
if (pElem && pElem->GetText())
StatusResponse = pElem->GetText();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2489 次 |
| 最近记录: |