i need help with my output statement dont know if its correct .. reading data file is ok .. but want to know how to send results to and output file .. please help
// DATAFILE
//------------------------------------------------------
// data file "depostit.txt"
ifstream infile ("c:/deposit.txt",ios::in);
if(!infile)
{cerr << endl << "file not opened" << endl;
exit(1);
}
while(!infile.eof())
{infile >> cust[i].fname;
infile >> cust[i].lname;
infile >> cust[i].acct;
infile >> cust[i].amt;
i++;
}
// OUTPUT FILE
//------------------------------------------------------
//output file call "output.txt"
ofstream outfile ("c:/output.txt",ios:ut);
if(!outfile)
{cerr << endl << "file not opened" << endl;
exit(1);
}
while(!outfile.eof())
{outfile >> cust[i].fname;
outfile >> cust[i].lname;
outfile >> cust[i].acct;
outfile >> cust[i].amt;
i++;
}



LinkBack URL
About LinkBacks
ut); 


