There are three special file pointers which are defined in stdio.h:

  • stdin refers to standard input from the keyboard
  • stdout refers to standard output on the screen
  • stderr refers to the standard error device (usually the screen)

Knowing this information, we can use fprintf just like we use printf():

is equivalent to:

 
©  |   Cornell University    |   Center for Advanced Computing    |   Copyright Statement    |   Inclusivity Statement