7.5.6 Standard I/O functions

Standard I/O functions are as follows.

Table 7.8

Standard I/O Functions

Function/Macro Name

Outline

printf

Write text in specified format to SFR

scanf

Read text in specified format from SFR

sprintf

Write text in specified format to character string

sscanf

Read text in specified format from character string

vprintf

Write text in specified format to SFR

vsprintf

Write text in specified format to character string

getchar

Read one character from SFR

gets

Read character string from SFR

putchar

Write one character to SFR

puts

Write character string to SFR

perror

Error processing

 

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