Probably, I don't know something about ifstream. I have binary file : 0604 0204 0a02.
std::ifstream input(input_filename, std::ios::binary);
unsigned char cmd;
unsigned char type;
while (!input.eof()) {
input >> cmd;
input >> type;
std::cout << static_cast<int>(cmd) << " " << (int)type << "\n";
}
And result of this code:
6 4
2 4
2 0
What is going wrong?