求助~~~~~~~~~~~~~~~~~~~~~~~
#include <fstream> #include <string>
using namespace std;
int main()
{
int a[5];
string b[5];
ofstream outfile("lala.txt",ios::out);
if( !outfile )
{
cerr << "open error!" << endl;
exit(1);
}
for(int i=0 ;i<5; i++)
{
cin >> b[i] >> a[i];
outfile << b[i] << " " << a[i] << endl;
}
outfile.close();
return 0;
}
此段在dev中就提示说,cin和cerr不存在,
觉得这段语法应该很标准,该怎么改啊?
同样是此段,用c-free编译,
让程序保存在编译器默认的文件夹,则能够运行
但是,保存在其他文件夹,则提示:no such file or directory
no input files