1) I have this code
//... many code below
std::basic_filebuf<char, std::char_traits<char> > streamIn;
streamIn.open("file.txt", std::ios_base::trunc | std::ios_base::out);
streamIn.sputn("Hello", 5);
//...
But in file.txt I see many many strange text. Not only Hello. This file also contaqins all my records from DB! I don't know why
2) Can I use std::basic_filebuf without file? Like std::basic_stringbuf
Solution for 1) is found
// ...
std::basic_filebuf<char, std::char_traits<char> > streamIn;
streamIn.open("file.txt", std::ios_base::out);
streamIn.sputn(responce.c_str(), responce.size());
streamIn.close();
streamIn.open("file.txt", std::ios_base::in);
//...