c++ - c ++ wcout停止输出,wofstream在一些调用后也停止输出
问题描述
我试图将内容输出到文件
std::locale::global(std::locale());
std::wofstream file(outfilename , std::wofstream::binary);
for (const auto & j : grid[0]) {
try {
std::wcout << L"String in WideString " << decoder->decode(j) << std::endl;
file << decoder->decode(j) << std::endl;
}
catch (std::exception& e) {
std::cout << e.what() << std::endl;
}
}
wcout 停止输出任何东西(即使是“WideString 中的字符串”也没有输出),经过一定次数的调用,
(我对其进行了调试,它在停止输出文本后像预期的那样执行 wcout)
wofstream 也会在相同数量的调用后停止输出。
这是我第一次使用widestrings、streams 和couts。
感谢您查看这个。
解决方案
这是€符号,它阻止 wcout 和 wofstream 工作,从输入文件中删除它,我从中获取数据,使一切按预期工作,非常奇怪
推荐阅读
- angular - Angular 6 Material - 无法读取未定义的属性“navigateByUrl”
- android - 如果不使用 PRO 帐户时使用 Webview,我可以在 android native 上使用 Vimeo 原生视频流吗?
- ios - UIView 切出任意数量的透明孔
- java - 我在 JTabbedPane 外部的框架内收到 JButton 的“错误:找不到符号”
- java - 无法启动活动 ComponentInfo:尝试在空对象引用上调用虚拟方法
- numpy - 通过重复的函数调用将数组附加到自身
- java - 如何在子类中正确调用超类的构造函数?
- python - NLTK Tokenizer 的算法复杂度
- statsmodels - 使用 statsmodels.formula.api 中的 ols 只有一个常数项?
- r - 在 r 中使用 ggplot 向 usmap 添加点