Hello everyone.
I wrote the a piece of code to join three files but there is an unwanted char/byte "ÿ" that shouldn't exist but does.
The result is something like
Code:
*FILE1**FILE2*ÿ*FILE3*ÿ
Instead of
*FILE1**FILE2**FILE3*
Any help would be appriecated.
My two questions are: Why is it there, and how can I stop it from appearing.
Code:
ifstream in("Text1.txt", ios::in | ios::binary);
ofstream out("Text3.txt", ios::out | ios::app | ios::binary);
if(in.is_open() && out.is_open())
{
while(!in.eof())
{
out.put(in.get());
}
}
in.close();
out.close();
ifstream in2("Text2.txt", ios::in | ios::binary);
ofstream out2("Text3.txt", ios::out | ios::app | ios::binary);
if(in2.is_open() && out2.is_open())
{
while(!in2.eof())
{
out2.put(in2.get());
}
}
in2.close();
out2.close();