Read binary file - efficiently
Posted on 2004-04-13
Please someone help me...
I need to read text file by each character in ascii
add 128 for the character (if it's ascii code smaller than 128)
<< don't change if the character is 1xxxxxxx,
do change 0xxxxxxx to 1xxxxxxx >>
then output the result to another file...
ifile >> c;
if(c < 128)
c = c + 128;
ofile << c;
I would like find some way more efficient,
such like read byte directly ....
since some of file is really hurge (text file, but more than 6MB)
so I actually read 10,000 character a time,
convert them by each character
then just write into the file...
but I think there are lots of efficient way
please help me...