I somehow can't get it right to use std::streamsize
to create an array.
// determine file size
file.ignore(std::numeric_limits<std::streamsize>::max());
std::streamsize length = file.gcount();
file.clear();
file.seekg(0, std::ios_base::beg);
// read data into buffer
std::array<char, length> buffer;
file.read(buffer.data(), length);
// copy the game into memory
std::copy(buffer.begin(), buffer.end(), memory.begin() + 0x200);
Error (translated from German)
The expression must be a constant value
Does anyone have any ideas on solving this problem? Any help is appreciated!