4.2
Standard I/O Function Interface Getchar
Inputs one character from the standard I/O device.
I Getchar
[Interface]
Format
Parameter
Return parameter chrcd
[Description]
Inputs one character from the standard I/O device. The function returns the input character if
input completes normally. If an error occurs, the function returns EOF (-1).
Whether or not getchar echoes input characters and whether or not it waits for key input are
determined by the operation of the input driver.
[Examples]
❍ Assembler interface
❍ C interface
int chrcd = getchar();
None
:Input code
EOF
#include scdef.inc
.import_getchar
callp _getchar
cbne a,#h'1a,endcode
:
:
#include "scdef.h"
prog()
{
int c ;
c = getchar() ;
:
:
}
4.2 Standard I/O Function Interface Getchar
:Error
*
29