object
stderr
<cstdio>
Standard error stream
The standard error stream is the default destination for error messages and other diagnostic warnings. Like
stdout, it is usually also directed to the output device of the standard console (generally, the screen).
stderr can be used as an argument for any function that expects an output stream as one of its parameters, like
fputs or
fprintf.
Although generally both
stdout and
stderr are associated with the same console output, applications may differentiate between what is sent to
stdout and what to
stderr for the case that one of them is redirected. For example, it is frequent to redirect the regular output of a console program (
stdout) to a file while expecting the error messages to keep appearing in the console screen.
It is also possible to redirect
stderr to some other destination from within a program using the
freopen function.