tried it with

fin.open(filename.c_str(), fstream::binary);

earlier... same result