gpt4 book ai didi

c++ - visual studio c++ 不会访问具有 3 个字母扩展名的文件

转载 作者:行者123 更新时间:2023-11-28 04:58:58 27 4
gpt4 key购买 nike

<分区>

Visual Studio 2013 Windows 7。

std::string filename1 = "hold.a";
std::ofstream filex(filename1, std::ios::binary);
filex << " Hello" << std::endl;
filex.close();

工作正常

std::string filename1 = "hold.txt";
std::ofstream filex(filename1, std::ios::binary);
filex << " Hello" << std::endl;
filex.close();

在创建文件时出现权限被拒绝错误。唯一的区别是输出文件的三个字母扩展名。

Ifstream 和 fopen 的行为方式相同。

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com