N
news.hku.hk
Hi there,
i have a binary file myfile.bin, the screen output of "od -t x1 myfile.bin"
is
0000000 7f 45 4c .............
0000020 12 13 7f 82
0000024
what i want to get is
7f 45 4c......
12 13 7f 82
but after i use the following commands, the last byte 82 is displayed as
ffffff82 !!??
Here is my commands:
cout << hex << setfill('0');
while (ifs2.get(ch2)) {
cout << int(ch2) << ' ' << setw(2);
}
i'd be grateful if i get any response, thanks a lot
Billy
i have a binary file myfile.bin, the screen output of "od -t x1 myfile.bin"
is
0000000 7f 45 4c .............
0000020 12 13 7f 82
0000024
what i want to get is
7f 45 4c......
12 13 7f 82
but after i use the following commands, the last byte 82 is displayed as
ffffff82 !!??
Here is my commands:
cout << hex << setfill('0');
while (ifs2.get(ch2)) {
cout << int(ch2) << ' ' << setw(2);
}
i'd be grateful if i get any response, thanks a lot
Billy