fork(1) download
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main(int argc, char ** argv){
  8. filebuf fb;
  9. fb.open ("test.txt",ios::out);
  10. std::ostream os(&fb);
  11. std::string test("test");
  12. os << test; // This line has the problem
  13. fb.close();
  14. }
Success #stdin #stdout 0.02s 2812KB
stdin
Standard input is empty
stdout
Standard output is empty