Created
May 4, 2020 03:09
-
-
Save jdx/242f98fb1820294c0042680892d38020 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fstream> | |
int main() { | |
std::ofstream f{"myfile.txt"}; | |
f << "sometext" << std::endl; | |
if (!f) | |
throw std::system_error(errno, std::system_category(), "failed to open file"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment