ok I am required to write a program that reads text from one file and writes it to another. I can do that easily enough but the second file the text is wrote to is supposed to have no spaces in between the words. how do I do this?
here is the code if that would help any.
#include <iostream.h>
#include <fstream.h>
int main ()
{
char in;
ifstream infile ( "in.dat" );
ofstream outfile ( "out.dat" );
if ((!infile) || (!outfile))
{
cout << "error opening file\n";
return 0;
}
while ( infile.get ( in ) )
{
cout<< in;
outfile << in;
}
infile.close;
outfile.close;
return 0;
}