Hey guys, you did such a wonderful job helping me last time, I figured I would bug you again
I am trying to pull information from one file to another file, and everytime I do that, it puts spaces between my characters, and doubles my last input so in essence file in is:
I went to the store
and the output to the other file is:
I w e n t t o t h e s t o r ee
The output on the screen is right except I get a double entry at the end as well. Any body got an idea? I am sure it has something to do with that crappy null character, but I still don't understand that fully. Any help would be appreciated. Here is my code:
#include <stdio.h>
#include <fstream.h>
#include <iostream>
char x;
char y;
void main()
{
ifstream inFile;
inFile.open("procedure.dat",ios::in);
ofstream outFile;
outFile.open("procedureout.dat",ios::out);
while (!inFile.eof())
{
inFile.get(x);
cout << x;
outFile.put(y) << x;
}
inFile.close();
outFile.close();