hi there...
never done this before so a little bit confused...
i'm dumping a binary (image) file bit by bit - one char per line - using fread. in the terminal i see something like:
<9D> 1
<A9> 2
<9E> 3
<D0> 4
<83> 5
^@ 6
^X 7
M 8
4 9
<DE> 10
: 11
` 12
<FF> 13
<D8> 14
<FF> 15
<E1> 16
^U 17
N 18
E 19
x 20
....
...
...
the thing is i need to start reading - in this case - line 13. i'm looking for the <FF> line. the <FF> char is not always on the same line..
the code i use to get the output above is:
Code:
FILE * fhin = fopen (argv[1], "rb");
char c;
int i = 1;
char * p;
p = &c;
while (fread (p, 1, 1, fhin) ) {
printf("%c\t%d\n", *p, i++);
}
fclose (fhin);
so basically i'm not sure how represent <FF> in a comparison within the while loop.. any help would be appreciated...
thanks...