system_getchar(3f) - [M_system:IO] reads a character from the stdin stream. (LICENSE:PD)
Synopsis
Description
Return Value
Return Value
Examples
integer(kind=c_int) function system_getchar(ch)
character(len=1),intent(in) :: ch
system_getchar(3f) read the character CH from the stdin stream via C I/O
getchar(3C) returns the character written as an unsigned char cast to an int or EOF(a negative value) on error. This is passed on to system_getchar(3f).
the status code. If negative an error occurred
Example program
program demo_system_getchar use M_system, only : system_getchar, system_putchar implicit none integer :: i integer :: iostat character(len=1) :: ch do while(system_getchar(ch).ge.0) iostat= system_putchar([) iostat= system_putchar(ch) iostat= system_putchar(]) enddo end program demo_system_getchar
Nemo Release 3.1 | system_getchar (3) | February 23, 2025 |