Whats the difference between ofstream “<<” and Write

I had opened a file in binary mode and like to write to an file .

   ofstream ofile("file.txt",ios_base::binary)
    int a = 1;
    float f = 0.1;
    string str = 10;
    ofile<<a<<f<<str;

Like to know what the difference between writing using "<<" and using "ofile.write" . which is the best and effective to write in binary mode.

8
задан Verve Innovation 1 December 2010 в 22:32
поделиться