При попытке записи в файл получаю ошибку segmentation failed (core dumped)
std::string filename{"output"};
std::fstream savef;
int ver{1};
savef.open(filename,std::fstream::out | std::fstream::binary | std::fstream::trunc);
savef.write(reinterpret_cast<char*>(ver),sizeof(ver)); //Здесь выбивает ошибку (если верить gdb)