Fast IO (ios_base) in C++

Can anyone help me what is significant of this below syntax in c++.
Also I need to know how exactly it works ?

ios_base::sync_with_stdio(false);
cin.tie(NULL);cout.tie(NULL);

1 Like

By default synchronisation with the standard c++ is on. This is computationally expensive. Turning it off saves some time during I/O.
Cin.tie(null)
This unties cin from cout . Tied streams ensure that one stream is flushed automatically before each I/O operation on the other stream.

Answers on this page are quite well explained: https://stackoverflow.com/questions/31162367/significance-of-ios-basesync-with-stdiofalse-cin-tienull

2 Likes