我正在尝试将字符串转换为 xmlChar。编译器表示不存在从 const string 到 xmlChar 的合适转换函数。代码如下所示:
bool ClassName::openFile(const String& ZipFile)
{
//convert
const xmlChar *temp = (const xmlChar)ZipFile; //ZipFile has an error here. ZipFile is path and filename
...
}
有什么想法吗?我用谷歌搜索了一下,人们正在从 xmlChar 转换为字符串,但不是这个方向。
最佳答案
xmlChar
只是 unsigned char
的 typedef。就这样写你的句子:
const xmlChar *temp = ZipFile.c_str();
关于c++ - 如何将字符串转换为 xmlChar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26765562/