Stdout
Stdout, short for standard output, is one of the standard data streams that a process can use to communicate output to its environment. In POSIX and similar systems, the three standard streams—stdin (input), stdout (output), and stderr (error)—are connected to the process via file descriptors, with stdout typically assigned to file descriptor 1. When a program writes to stdout, its output is intended for the main output channel of the program.
By default, stdout is connected to the terminal that started the process. However, it can be redirected
In C, the standard library exposes stdout as a FILE* stream, used by functions like printf and
Stdout is distinct from standard error, which uses file descriptor 2 and is intended for diagnostic messages.
On Windows, stdout is similarly mapped to the console or a file, and can be redirected; some