I have two files, input and target. I would like to read the input file and output its data in hexidecimal format into the target file. I have the following code but it just reads the file exactly as it is from one to the other, not creating any conversions?...could anyone point me in the right direction
using namespace std;
char ch;
ifstream source_file("c:\\bollock\\mine.txt", ios::in |ios::out|ios::binary);
ofstream target_file("c:\\bollock\\target.txt");
while ((ch = source_file.get()) !=EOF)
{
cout << hex << source_file << endl;
target_file.put(ch);
}
source_file.close();
target_file.close();


Ask A New Question
Reply






MultiQuote






|