How to read one byte from a file? The following code works, but some bytes are skipped ( 0x09, 0x0a, 0x0b, 0x0c, 0x0d ) and the next byte is read.
ifstream file(fileName, std::ios_base::in | std::ios_base::binary); uint8_t s; file >> s; Tried to do more like this,
file.readsome(&s, 1); but uint8_t* does not cast to char* . I use uint8_t because, as far as I know the standard, the size of the char is not regulated.
What is the problem?