Hey,
Just a question on the code i've posted below.
It writes to the file out.bin but when i view it (thru notepad or edit or whatever) i can see the word "HELLO".
If this is a "binary" file should i be able to see the characters like that? I thought i mite get the bit equivalents.....
Code:
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ofstream outFile;
char file[8] = "out.bin";
char buffer[10] = "HELLO";
outFile.open(file, ios::out | ios::binary);
outFile.write (reinterpret_cast< const char* >(buffer), 5);
outFile.close();
return 0;
}
Cheers gang.
Rob.