SyntaxFix
Write A Post
Hire A Developer
Questions
Assuming you're using a std::ofstream to write to file, the following snippet will write a std::string to file in human readable form:
std::ofstream
std::string
std::ofstream file("filename"); std::string my_string = "Hello text in file\n"; file << my_string;