int readWriteFile(
string srcFile,
string dstFile)
{
cout <<
"in File" << srcFile << endl;
cout <<
"out File" << dstFile << endl;
ifstream
in(srcFile.c_str());
if (!
in.is_open())
{
cout <<
"open src File Error opening file" << endl;
return -
1;
}
ofstream
out(dstFile.c_str());
if(!
out.is_open())
{
cout <<
"open dst File Error opening file" << endl;
return -
1;
}
char* buffer =
new char[
1024];
while (!
in.eof())
{
in.read(buffer,
1024);
cout << buffer << endl;
out.write(buffer,
1024);
}
in.close();
out.close();
return 0;
}