one thing you might want to try is
Code:
...
ifs.write((unsigned __int8 *)word, 2);
char is not guaranteed to be exactly 8 bits.
edit: excuse me, i mean
Code:
...
ifs.write((char *)word, (2 * float( sizeof(_int8) / sizeof(char) )) );
edit again: if nothing else, try
Code:
fstream ifs(name, ios::out | ios::trunc | ios::binary);
char word[2];
cout << sizeof(char) << endl;
word[0]= 0;
word[1]= 10;
if(!ifs.write((char *)word, 2))
throw new fileio_error("Cannot write width to file.");
hopefully size of char is 1. that WILL write 0x00, 0x0A
if size of char is 2 then:
Code:
fstream ifs(name, ios::out | ios::trunc | ios::binary);
char word[2];
word[0] = 10;
if(!ifs.write((char *)word, 1))
throw new fileio_error("Cannot write width to file.");