1>项目:错误 PRJ0003:无法生成“rc.exe”.. 当我尝试运行这个小的读写文件的练习程序时,我遇到了这个错误,因为我无法正确打开文件。我使用的是 Microsoft Visual C++ 2008,我已经使用文件路径尝试打开文件,但是我还是无法打开。有人能帮忙吗?
#include <iostream>
#include <fstream>
using namespace std;
int main ()
{
ifstream infile;
ofstream myfile;
int num;
infile.open("example.txt");
if(infile.fail())
{
cout << "error" << endl;
}
myfile.open ("example.txt");
if(infile.fail())
{
cout << "error" << endl;
}
while(!infile.eof())
{
example >> num;
}
while(!myfile.eof())
{
example << num;
}
infile.close();
myfile.close();
return 0;
}