Just out of curiosity I commented out the lines that performed "flush()" and the output still remains same.
So, is it really necessary to use flush()?
If yes, then under what circumstances do we actually need to use flush()?
I have poked around close() API and couple of other threads in this forum and it says close() API flushes first and then it closes.
It looks like its behaving this way (at least in the above code
).
Thanks
Chintan.