如何使其工作? C++類型真的讓人困惑:將常量wchar_t *轉換爲WCHAR *
std::wstring wquery = std::wstring(query.begin(), query.end());
//split names
std::vector<WCHAR*> split_names;
std::stringstream ss;
ss.str(names);
std::string name;
while (std::getline(ss, name, ',')) {
split_names.push_back(
(
std::wstring(
name.begin(),
name.end()
)
).c_str()
); //error can't assign const wchar_t* into WCHAR*
}
什麼是查詢在這裏?請提供[MCVE](http://stackoverflow.com/help/mcve) – wasthishelpful
它們不相等? –
你爲什麼使用'WCHAR',以及它是如何定義的。 –