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.