0

我正在尝试使用 boost 模块和 c++ 从文件中搜索一个单词,但我遇到了这个错误消息:

error: cannot convert 'const value_type* {aka const wchar_t*}' to 'const char*' in initialization

错误来自这行代码:

const char* file_path = itr->path ().filename ().c_str();

谢谢。

4

1 回答 1

3

它告诉你你需要这个:

const wchar_t* file_path = itr->path ().filename ().c_str();
于 2012-05-13T15:50:11.333 回答