I'm trying to get std::string from attribute's value with TinyXml. The only thing I can get is a const char * val, and I can't find any way to convert from const char * to a std::string.
so two possible answers to that: 1. How to get a string of an attribute with TinyXml? 2. How to convert const char * val to string val.
this is the code I have now:
TiXmlElement* data;
data->Attribute("some_name"); // return const char * which seems like unconvertible.
After googeling, I tried this:
char * not_const= const_cast<char *> (data->Attribute("some_name"));
There are no errors in the code itself, but after compiling and running I get exceptions.