"ofstream::<<" looks much easier to use then "ofstream::write".
Any concerns that we should rather use "ofstream::write"?
Maybe buffer overflows and such?
PS There is a typo in the title meant to be ofstream, Sorry.Code:#include <fstream> #include <string> #include <iostream> using namespace std; ofstream file("test.txt" ); int main() { string f,i; f = "Hello\n"; i = " world\n"; file.write("Hello", 5); file.write(i.c_str(),7); file << "Hello" << i; return 0; }