Espaces de noms
Variantes
Affichages
Actions

std::ios_base::sync_with_stdio

De cppreference.com
< cpp‎ | io‎ | ios base

 
 
D'entrée / sortie de bibliothèque
I / O manipulateurs
C-style I / O
Tampons
Original:
Buffers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf
basic_filebuf
basic_stringbuf
strstreambuf (obsolète)
Cours d'eau
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Abstractions
Original:
Abstractions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base
basic_ios
basic_istream
basic_ostream
basic_iostream
Fichier E / O
Original:
File I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ifstream
basic_ofstream
basic_fstream
Chaîne I / O
Original:
String I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istringstream
basic_ostringstream
basic_stringstream
Tableau I / O
Original:
Array I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
istrstream (obsolète)
ostrstream (obsolète)
strstream (obsolète)
Types
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
streamoff
streamsize
fpos
Interface catégorie d'erreur
Original:
Error category interface
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
iostream_category (C++11)
io_errc (C++11)
 
std::ios_base
Les fonctions membres
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base::ios_base
ios_base::~ios_base
Mise en forme
Original:
Formatting
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base::flags
ios_base::setf
ios_base::unsetf
ios_base::precision
ios_base::width
Locales
Original:
Locales
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base::imbue
ios_base::getloc
Interne gamme extensible
Original:
Internal extensible array
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base::xalloc
ios_base::iword
ios_base::pword
Divers
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base::register_callback
ios_base::sync_with_stdio
Classes de membres
Original:
Member classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base::failure
ios_base::Init
Types de membres
Original:
Member types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base::openmode
ios_base::fmtflags
ios_base::iostate
ios_base::seekdir
ios_base::event
ios_base::event_callback
 
static bool sync_with_stdio( bool sync = true );
Indiquer que la norme std::cin, std::cout, std::cerr, std::clog, std::wcin, std::wcout, std::wcerr et std::wclog C + + flux sont synchronisés à la norme stdin, stdout, stderr et C stdlog flux après chaque opération d'entrée / sortie .
Original:
Sets whether the standard std::cin, std::cout, std::cerr, std::clog, std::wcin, std::wcout, std::wcerr and std::wclog C++ streams are synchronized to the standard stdin, stdout, stderr and stdlog C streams after each input/output operation.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Pour une str flux standard, synchronisé avec le flux f C, les paires de fonctions suivantes ont un effet identique:
Original:
For a standard stream str, synchronized with the C stream f, the following pairs of functions have identical effect:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1) std::fputc(f, c) and str.rdbuf()->sputc(c)
2) std::fgetc(f) and str.rdbuf()->sbumpc(c)
3) std::ungetc(c, f) and str.rdbuf()->sputbackc(c)
Dans la pratique, cela signifie que le C + + et C utilisent les cours d'eau du même tampon, et, par conséquent, peuvent être mélangés librement. En outre, synchronisé C + + flux sont garantis thread-safe (individuel sortie personnages de plusieurs threads peuvent s'imbriquer, mais pas de races de données se produisent)
Original:
In practice, this means that the C++ and the C streams use the same buffer, and therefore, can be mixed freely. In addition, synchronized C++ streams are guaranteed to be thread-safe (individual characters output from multiple threads may interleave, but no data races occur)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Si la synchronisation n'est pas activé, le C + + flux standards sont autorisés à amortir leur E / S de façon indépendante, qui peuvent être beaucoup plus rapide dans certains cas .
Original:
If the synchronization is turned off, the C++ standard streams are allowed to buffer their I/O independently, which may be considerably faster in some cases.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Par défaut, tous les huit standards C + + flux sont synchronisés avec leurs sources respectives C .
Original:
By default, all eight standard C++ streams are synchronized with their respective C streams.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Il est défini par l'implémentation si cette fonction n'a aucun effet si elle est appelée après un certain E / S s'est produite dans le flux standard .
Original:
It is implementation-defined if this function has any effect if called after some I/O occurred on the standard stream.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Sommaire

[modifier] Paramètres

sync -
le réglage de synchronisation
Original:
the new synchronization setting
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Retourne la valeur

état de synchronisation avant l'appel de la fonction
Original:
synchronization state before the call to the function
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Exemple

#include <iostream>
#include <cstdio>
int main()
{
    std::cout.sync_with_stdio(false);
    std::cout << "a\n";
    std::printf("b\n");
    std::cout << "c\n";
}

Résultat :

b
a
c

[modifier] Voir aussi

écrit à la norme C stdout
(
objet global
Original:
global object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
)
flux de sortie
Original:
writes to the standard C output stream stdout
(
objet global
Original:
global object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[edit]
écrit dans le flux d'erreur standard C stderr, unbuffered
(
objet global
Original:
global object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
)
Original:
writes to the standard C error stream stderr, unbuffered
(
objet global
Original:
global object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[edit]
écrit à la norme C stderr
(
objet global
Original:
global object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
)
flux d'erreur
Original:
writes to the standard C error stream stderr
(
objet global
Original:
global object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[edit]