mardi 15 mars 2016

Writing and Reading a random number state to file

I am trying to save the state of a random number generator as follows:

std::mt19937 rng
std::ofstream ofile("RngState.txt");
ofile << rng;
ofile.close();

What I observe is the state is a vector of 1248 numbers And only 624 numbers get written in the file. Is there a way to write and read all the 1248 numbers in one attempt(I guess I am trying to increase the capacity/size of ofstream).

Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire