c - 尝试使用带有 WSL 工具链的 CLion 读取文件时遇到问题
问题描述
代码路径为:C:\Users\*****\CLionProjects\bst
文件路径为:C:\Users\*****\CLionProjects\bst\Resources\students
文件内容为:
AB123456 ASD SMITH 1.0
AB234567 OMAR SDF 30.0
AB345678 XCV WER 69.0
我的代码是:
FILE *input = fopen("Resources\\students", "r");
if(!input){
printf("Error while opening the file.");
exit(-1);
}
输出是:
Error while opening the file.
Process finished with exit code 255
我也尝试过绝对路径或更改文件扩展名,但输出不会改变。我从来没有在 Linux 上遇到过这个问题。我应该怎么办?
解决方案
推荐阅读
- html - 绝对定位的子 div 宽度,离开相对定位的容器
- kubernetes - 在 K8s 集群之间移动带有 PV 的 Statefulset
- c# - yield return IEnumerator 或 IEnumerable
- python - 使用 python-gitlab 列出所有项目时列出索引超出范围
- mysql - 如何在MySQL中特定列中第一次出现另一个值的行中获取列的值?
- scripting - 脚本中的字符串匹配
- java - 带点字符的字符串拆分不起作用
- python - 如何在 django admin 中将纪元时间整数字段转换为日期时间字段
- python-3.x - 如何在 CSV 文件的列中获取一些值并将其导出到 python 数组
- spring-boot - Spring Integration ServiceActivator 是否适用于项目反应器类型?