0

is it possible to load strings from tinyXML file to string variable in application because when I'm trying to do that I received some bugs.

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

the error is: "type is not allowed". Could you write any example of using strings?

David
  • 39
  • 9
  • You *have* called functions before? Did you use the type of the arguments then? You clearly know that you should not do that, as you don't do that for the first argument. – Some programmer dude Feb 13 '16 at 17:16

1 Answers1

0

You shouldn't use type qualifier before the argument when calling function. You might want

if (fall->QueryFloatAttribute("particle_texture", /*std::string*/ name_) != XML_NO_ERROR)
                                                  ~~~~~~~~~~~~~~~
songyuanyao
  • 169,198
  • 16
  • 310
  • 405
  • alright but when I delete std::string and I leave only "name_", there is error: " no suitable conversion function from std::string to float" – David Feb 13 '16 at 17:22
  • @David. The argument doesn't match. You need to pass an argument with type `float` to it. (but AFAIK it should be a `float*`?) – songyuanyao Feb 13 '16 at 17:40
  • yes you're right mate, I just noticed that but still don't know how to make correct string loading from document. Maybe you have any example or something it would be very helpfull for me. – David Feb 13 '16 at 17:47
  • @David. Sorry I'm not familiar with TinyXml. But SO is a Q&A forum, if you have another question, please describe it as a specified and concrete question, then we might be able to help you. Good luck! – songyuanyao Feb 13 '16 at 18:06