Don't use the eof() method to test for end of file. Think about it - it isn't going to go "true" until you have tried and failed to read the file (with rfile >> ch1). But if the latter failed then it had nothing new to put in ch1, so it just writes what it had previously to qfile.
Test on the condition of the stream after an attempted read instead.
1 2 3 4
while(rfile>>ch1)
{
qfile << ch1;
}
Similarly for the other filestream.
BTW - the stream extractor >> will, by default, ignore spaces in the input file. Is that what you intended?
If you want a space between the output from one file and the next then just output one explicitly: qfile<<' ';
If you want to write a space only if there isn't one at the end of the first file then if ( ch1 != ' ' ) qfile<<' ';
(presuming ch1 to have the last character read successfully from the first file.