N
news.hku.hk
i have a binary file "myfile.bin", its output of "od -t x1 myfile.bin" is:
0000000 7f 45 4c 46 01 02 01
and longer. i want the output to screen be:
7f 45 4c 46 01 02 01
i try to write the program like that:
char ch2;
ifstream ifs ("myfile.bin", ios:binary|ios::in);
while (ifs.get(ch2)) { *****
cout.put(ch2); *****
}
ifs.close(); return 0;
i think the two lines with ***** are problematic, could anyone gives me a
helping hand? thanks for reading this post.
0000000 7f 45 4c 46 01 02 01
and longer. i want the output to screen be:
7f 45 4c 46 01 02 01
i try to write the program like that:
char ch2;
ifstream ifs ("myfile.bin", ios:binary|ios::in);
while (ifs.get(ch2)) { *****
cout.put(ch2); *****
}
ifs.close(); return 0;
i think the two lines with ***** are problematic, could anyone gives me a
helping hand? thanks for reading this post.