TinyXML 从文件加载字符串

TinyXML load string from file

本文关键字:字符串 加载 文件 TinyXML      更新时间:2023-10-16

是否可以将字符串从tinyXML文件加载到应用程序中的字符串变量,因为当我尝试这样做时,我收到了一些错误。

if (fall->QueryFloatAttribute("particle_texture", std::string name_) != XML_NO_ERROR)
        return false;

错误是:"不允许键入"。你能写一些使用字符串的例子吗?

调用函数时,不应在参数前使用类型限定符。你可能想要

if (fall->QueryFloatAttribute("particle_texture", /*std::string*/ name_) != XML_NO_ERROR)
                                                  ~~~~~~~~~~~~~~~