for (int i = 0; i < rlen; i++)
{
printf("%x\n", fgetc(input));
}
do it that way
r0ckbaer
Junior Poster in Training
55 posts since Dec 2003
Reputation Points: 13
Solved Threads: 6
Well, normally fgetc gets one char per loop (in the above example) and increments the file pointer with 1, so:
a1 b3 8 9a
would be a result after 4 loops.
Be more specific on how you want the output to look like and if possible paste a snapshot of the hexdump of lets say the first 50 bytes of the file u want to analyze.
r0ckbaer
Junior Poster in Training
55 posts since Dec 2003
Reputation Points: 13
Solved Threads: 6
for (int i = 0; i < rlen; i++)
{
printf("%x\n", fgetc(input));
}
do it that way
this is wrong. you cannot just call functions without checking the error return of them. fgetc() can fail, and must be checked. and from the ff output u can tell that it is trying to tell u something!! that is EOF or error being returned! lets see the rest of the code.
infamous
Junior Poster in Training
77 posts since Mar 2004
Reputation Points: 47
Solved Threads: 2