I have some huge data to be written to a file. So instead of writing line by line, I want to write many a lines at a time to save time.
Each line has something of this kind
12938 12343
This is how I am doing right now.
outFile<<num1<<" "<<num2<<endl;
So instead of writing line by line I want to write many lines(say 10000) at a time. How do I do that?
I was thinking of concatening all these lines to a string and then write this string to the file. But in that case I have to write them to a temp string everytime and then concatenate. Due to which I am not gaining much. Is there any better way to do that?