Espacios de nombres
Variantes
Acciones

std::cerr, std::wcerr

De cppreference.com
< cpp‎ | io

 
 
Entrada / salida de la biblioteca
I / O manipuladores
C-estilo I / O
Buffers
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(obsoleto)
Arroyos
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Abstracciones
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
File I / 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
Cadena de 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
Matriz 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(obsoleto)
ostrstream(obsoleto)
strstream(obsoleto)
Tipos
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
Error interfaz categoría
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::basic_ostream
Los objetos globales
Original:
Global objects
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cerr
wcerr
Las funciones miembro
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.
basic_ostream::basic_ostream
basic_ostream::~basic_ostream
basic_ostream::operator=(C++11)
Entrada con formato
Original:
Formatted input
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::operator<<
Entrada sin formato
Original:
Unformatted input
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::put
basic_ostream::write
Posicionamiento
Original:
Positioning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::tellp
basic_ostream::seekp
Varios
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::flush
basic_ostream::swap(C++11)
Clases de miembros
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.
basic_ostream::sentry
Terceros funciones
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
operator<<(std::basic_ostream)
 
Defined in header <iostream>
extern std::ostream cerr;
(1)
extern std::wostream wcerr;
(2)
Los objetos globales std::cerr y std::wcerr salida de control a un búfer de la secuencia de aplicación definido por el tipo (derivado de std::streambuf y std::wstreambuf, respectivamente), asociada con el flujo de salida estándar C error stderr .
Original:
The global objects std::cerr and std::wcerr control output to a stream buffer of implementation-defined type (derived from std::streambuf and std::wstreambuf, respectively), associated with the standard C error output stream stderr.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Estos objetos están garantizados para ser construido antes de la primera constructor de un objeto estático se llama y que están garantizados para sobrevivir a la última destructor de un objeto estático, por lo que siempre es posible escribir en std::cerr en código de usuario .
Original:
These objects are guaranteed to be constructed before the first constructor of a static object is called and they are guaranteed to outlive the last destructor of a static object, so that it is always possible to write to std::cerr in user code.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
A menos que sync_with_stdio(false) se ha emitido, se puede acceder a estos objetos simultáneamente desde varios subprocesos, tanto para la salida con formato y sin formato .
Original:
Unless sync_with_stdio(false) has been issued, it is safe to concurrently access these objects from multiple threads for both formatted and unformatted output.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Una vez inicializado, std::cerr.flags() & unitbuf != 0 (lo mismo para wcerr) que significa que cualquier señal que se envía a estos objetos de flujo se sonrojó inmediatamente al sistema operativo (a través del destructor std::basic_ostream::sentry) .
Original:
Once initialized, std::cerr.flags() & unitbuf != 0 (same for wcerr) meaning that any output sent to these stream objects is immediately flushed to the OS (via std::basic_ostream::sentry's destructor).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Además, std::cerr.tie() vuelve &std::cout (el mismo para wcerr y wcout), lo que significa que cualquier operación de salida en std::cerr primero ejecuta std::cout.flush() (a través del constructor std::basic_ostream::sentry) (desde C++11)
Original:
In addition, std::cerr.tie() returns &std::cout (same for wcerr and wcout), meaning that any output operation on std::cerr first executes std::cout.flush() (via std::basic_ostream::sentry's constructor) (desde C++11)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Ejemplo

salida a stderr a través de oleadas de cerr fuera la salida en pendiente cout, mientras que la salida stderr a través de zueco no
Original:
output to stderr via cerr flushes out the pending output on cout, while output to stderr via clog does not
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

#include <thread>
#include <iostream>
#include <chrono>
void f()
{
    std::cout << "Output from thread...";
    std::this_thread::sleep_for(std::chrono::seconds(2));
    std::cout << "...thread calls flush()" << std::endl;
}
 
int main()
{
    std::thread t1(f);
    std::this_thread::sleep_for(std::chrono::seconds(1));
    std::clog << "This output from main is not tie()'d to cout\n";
    std::cerr << "This output is tie()'d to cout\n";
    t1.join();
}

Output:

This output from main is not tie()'d to cout
Output from thread...This output is tie()'d to cout
...thread calls flush()

[editar] Ver también

inicializa los objetos estándar de la corriente
Original:
initializes standard stream objects
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público of std::ios_base clase) [edit]
escribe en el stderr
(objeto global) corriente estándar de C error
Original:
writes to the standard C error stream stderr
(objeto global)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[edit]
escribe en el stdout
(objeto global) corriente estándar C de salida
Original:
writes to the standard C output stream stdout
(objeto global)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[edit]