char x[5];
ifstream i("test.txt", std::ifstream::binary);
while (i.read(x, sizeof(x))) {
...
bzero(x, sizeof(x));
}
If the file byte size is not a multiple of 5, the program fails to read the last chunk. How do I make sure to read that as well?