std::ios_base::sync_with_stdio
Min standard notice:
Sets whether the standard C++ streams are synchronized to the standard C streams after each input/output operation.
# Declarations
static bool sync_with_stdio( bool sync = true );
# Parameters
sync: the new synchronization setting
# Return value
Synchronization state before the call to the function.
# Example
#include <cstdio>
#include <iostream>
int main()
{
std::ios::sync_with_stdio(false);
std::cout << "a\n";
std::printf("b\n");
std::cout << "c\n";
}
# Defect reports
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| LWG 49 | C++98 | it was unspecified (1) which state is actually returned and(2) what does ‘synchronized’ between standard C and C++ streams mean | both specified |