Input file is ASCII text file (*fr). Each double-seguential-text-characters are one Hexa-number:
A0 = 0xA0, FF = 0xFF, etc.
I need to write 0xA0 0xFF to new binary file (*fw). It is no problem with "fwrite".
Problem for me is with reading of each 2 seguential characters from text file. I used loop with:
for (j = 0; j < 2; j++)
fread (&a, 1, 1, fr);
fread (&b, 1, 1, fr);
j = 0;
First 2 characters are reading OK but all next characters are shifted with one text character Eg.:
input file: AABBCCDDEE
shifted output: AA BC DD etc.
I tried also aply loop with "fseek (fr, 0, (SEEK_SET+i))" but without success.
Could you please help me? I cannot find solution on this board.