Standard I/O functions are as follows.
Specifications are implemented, so that in each function, input from stdin is performed through the getchar function and output to stdout is performed through the putchar function.
To change stdin and stdout, replace the getchar function and putchar function, respectively.
Output to stderr in the perror function is the same as output to stdout, and so it is performed through the putchar function. Note that replacing the putchar function will also change stderr. To change the output destination of stderr to something other than stdout, replace the perror function