Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Ziaeemehr
Created January 1, 2020 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ziaeemehr/54dc15e05245aa9a6eb6025466d7dcf6 to your computer and use it in GitHub Desktop.
Save Ziaeemehr/54dc15e05245aa9a6eb6025466d7dcf6 to your computer and use it in GitHub Desktop.
// open file as binary:
std::ofstream oX((path + "/X.bin").c_str(), std::ios::out | std::ios::binary);
// write a vector into the file
oX.write((char *)&x[0], x.size() * sizeof x[0]);
// close the file
oX.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment