If any input or output operation has occurred using the standard streams prior to the call, the effect is implementation-defined. Meaning: it depends on compiler if sync_with_stdio used after read/write from/to cin/cout.
So call this exactly once before any read/write operation.
About
sync_with_stdio
:If any input or output operation has occurred using the standard streams prior to the call, the effect is implementation-defined
. Meaning: it depends on compiler ifsync_with_stdio
used after read/write from/tocin/cout
.So call this exactly once before any read/write operation.