【发布时间】:2021-06-03 15:47:00
【问题描述】:
我试图打开一个文件,就像其他人一样,但它不起作用。 我浪费了太多时间寻找解决方案和东西,但什么也没有! 在我的另一个项目中,它可以工作,但在这里不行。
我不知道这是否与任何事情有关,但我在打开 std::ifstream 时仍然打开了一个 std::ofstream(“流”变量)
顺便说一句。文件路径是: C:\Users\no\Desktop\GlassStudios\GlassEngine\Source\x64\Debug\Content\Asset.txt
将反斜杠更改为斜杠(“/”)也不起作用
这是我的代码:
for (size_t i = 0; i < tmpfl.size(); i++) // tmpfl is a std::list<std::string>
{
std::ifstream data(tmpfl.begin()->c_str(), std::ios::binary); // Stream is empty all the time
tmpfl.pop_front();
int start = stream.tellp(); // this is for an unrelated part
while (!stream.eof()) // this is for an unrelated part
{
WriteEncrypted(key, (char)data.get(), &stream); // this is for an unrelated part
}
data.close(); // this is for an unrelated part
int end = stream.tellp(); // this is for an unrelated part
}
请帮忙
【问题讨论】: