std::vector<<span class="s2">char> *buffer ; std::stringstream path; std::ofstream fout(path.str().c_str(), std::ios::binary | std::ios::app); for (unsigned int i = 0; i < buffer->size(); ++i) { fout.write(&(*buffer)[i], sizeof(char)); } fout.close();