Hi guys. What can I use to write and read, in order to deal with the full character set 0-255? I include the program that will prove that it doesn’t work. This is the best write and read I could find. I’m using Visual C++ Thank you.
unsigned char Ch1;
int ix, iNumOut;
const string TEST_FILE = “T1.DAT”;
// Write
ofstream testout(TEST_FILE, ios::binary);
for (ix = 0; ix <= 255; ix++)
testout << char(ix);
testout.close();
// Read
ifstream testin(TEST_FILE, ios::binary);
for (ix = 0; ix <= 255; ix++)
{
testin >> Ch1;
iNumOut = Ch1;
cout << iNumOut << ", ";
}
testin.close();