Question about io_base::sync_with_stdio(false)
I´ve read that this call before any use of streams will improved performance because it breaks the sincronization of C++ with C on io operations.
questions:
1) It improves the performance only on stardard streams (cerr cin and cout), or any file will have the performance improved?
2) since I use it I can´t make anymore any call to C standard streams (of course only if I call it again with true as parameter) Is this correct?
Thank you.
Re: Question about io_base::sync_with_stdio(false)
Whether this yields any performance increase is questionable, and definitely implementation specific. You are welcome to test it with profiler and post your results.
1) only standard streams (cin,cout,cerr,...) are affected.
2) you can call them, but as they are not synchronized you may get unexpected results.
Also, i've looked into the standard and it says:
Effects: If any input or output operation has occurred using the standard streams prior to the call, the effect is implementation-defined.
Re: Question about io_base::sync_with_stdio(false)
Mixing of C++ and C io stream operations is something you should refrain from. Keep it simple, keep it consistent.
Re: Question about io_base::sync_with_stdio(false)
Finally, note that under VC++'s standard library (by Dinkumware), ios_base::sync_with_stdio(false) is a no-op!
Re: Question about io_base::sync_with_stdio(false)
Ok, thank you all for your explantions.