std::ifstream file(logFile, std::ifstream::binary);
std::vector<unsigned char> _data;
file.seekg(0, file.end);
int _originalFileSize = file.tellg();
file.seekg(0, file.beg);
_data.reserve(_originalFileSize);
file.read(reinterpret_cast<char*>(&_data[0]), _originalFileSize);
file.read(reinterpret_cast<char*>(&_data[0]), _originalFileSize);
That line generates a vector subscript out of range exception.
If I try:
file.read(reinterpret_cast<char*>(_data.data()), _originalFileSize);
There's no exception but not data gets loaded into the vector.
And yes, the file is not empty, it has over 18 000 bytes worth of data in it...