c++ - getline() 在尝试读取重读字母后停止工作
问题描述
我有一个 .csv 文件,其中包含以下内容:
leería toda la linea,
si pudiera,
我尝试使用以下代码阅读它:
#include <iostream>
#include <fstream>
#include <string>
int main(){
std::wstring wstr;
std::wifstream FILE("data.csv");
if(FILE){
getline(FILE, wstr, L',');
std::wcout << wstr << std::endl;
FILE.close();
} else {
std::cout << "The file failed to open";
}
FILE.close();
return 0;
}
输出是:
leer
到达“í”后似乎停止阅读。为什么我的代码不起作用?
解决方案
推荐阅读
- flutter - 一个接一个地运行相同的颤振测试。1成功1失败
- c# - Mac 上不存在指定的 deps.json
- android - 使用协程时无法捕获网络错误,但可以在 RxJava 2 中捕获该错误。我错过了什么?
- javascript - 使用弹出窗口内的表单编辑 DataTables 源数据
- linux - 如何将 colab 我的云端硬盘文件夹重命名为其他名称?
- javascript - How can I programmatically trigger ripple effect on a Vuetify.js component?
- javascript - jQuery animate API 多次触发
- java - 我无法连接到本地主机(Openserver、JDBC、MySQL)
- python - 获取 AttributeError:“TestRoutes”对象没有属性“app”
- java - 无法使用 Tomcat9 访问本地主机