【发布时间】:2013-05-11 17:17:40
【问题描述】:
我们如何在 C++11 中将 u32string 转换为 int?
另外,我应该使用什么方法将此类字符串的一部分转换为int - 假设有可用的开始和结束迭代器?
我试过了:
u32string test=U"14";
cout << atoi(test.c_str());
但它会抛出:
candidate function not viable: no known conversion from 'const char32_t *' to 'const char *' for 1st argument
extern int atoi (__const char *__nptr)
【问题讨论】:
标签: c++ string c++11 localization type-conversion