C Standard Library

C <stdio.h> - stdout



The C <stdio.h> stdout is a predefined stream. It is associated with the standard output stream, which is the default destination of output for applications. In most systems, it is usually directed by default to the text console (generally, on the screen). At program startup, the stream is fully buffered if and only if the stream can be determined not to refer to an interactive device.

stdout is expanded to expressions of type FILE*. Therefore, it can be used with any function which expects an output stream (FILE*) as one of its parameters, like fputs() or fprintf().

In the <stdio.h> header file, it is defined as follows:

#define stdout /* implementation-defined */

Example:

In the example below, stdout is used with fputs() function to print the content on the screen.

#include <stdio.h>
 
int main (){

  //prints str on screen
  char str[50] = "Hello World!";
  fputs(str, stdout);
  
  return 0;
}

The output of the above code will be:

Hello World!

❮ C <stdio.h> Library