Given a file containing the following hex code: 0B 00 00 00 00 00 20 41
I\'m trying to populate an std::vector
istream_iterator should not be used for reading binary files. It uses operator>>, which is also not suited for reading binary files (unless those files are of a very specific format which most binary files do not fit). You can use istreambuf_iterator instead. You also want to be sure to open your file in binary mode.
in.open("filepath", std::ios::in | std::ios::binary);