作业帮 > 综合 > 作业

{ofstream outtemp1("temp1.txt",ios::out);ofstream outData("t

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/22 17:14:35
{
ofstream outtemp1("temp1.txt",ios::out);
ofstream outData("temp.txt",ios::out);
ifstream indata("Personal system of accounting.txt",ios::in);
if outData || indata)
{
cout
ofstream outtemp1("temp1.txt",ios::out);//定义一个输出流对象outtemp1,就是可以向temp1.txt这个文件写数据
ofstream outData("temp.txt",ios::out);//定义一个输出流对象outData,就是可以向temp.txt这个文件写数据
ifstream indata("Personal system of accounting.txt",ios::in);//定义一个输入流对象 indata,可以从
Personal system of accounting.txt这个文件中取出数据
if (!outData || !indata) //通过判断文件流对象的返回值判断文件是否存在.这里少了一个"||!outtemp1"
{
cout