[c++] How to write std::string to file?