int main ()
{
ifstream fin;
ofstream fout;
char infileName[21], outfileName[21];
cout<<" Enter the file name of the source file not longer than 20 characters \n";
cin>>infileName;
cout<<" Enter the file name of the output file not longer than 20 characters \n";
cin>>outfileName;
cout<<" Begin editing files \n";
fin.open(infileName);
if (fin.fail())
{
cout<<" Input file opening failed.\n";
exit(1);
}
fout.open(outfileName);
if (fin.fail())
{
cout<<" Output file opening failed.\n";
exit(1);
}
what problems, *exactly*, are you having? You have the right idea...
while(inStream.getline(line, 50)) //the eof technique has problems, this is the accepted way.
{
outStream<<"Line Number " <<numberLine++<<':'<<' '<<line<<endl; //++condense not necessary
}
ok. now put it in code tags <> on the side bar editor, and explain what isnt working in enough detail that I don't have to copy it, paste it, download it, try to guess the problem, and fix it. Help us help you. You appear to have ignored my first post, I still see that EOF logic which has problems.