C Library Functions - getchar (3)
NAME
getchar(3f) - [M_io:QUERY] read a single-byte character from stdin via C interface
(LICENSE:PD)
CONTENTS
Synopsis
Description
Options
Returns
Examples
Author
License
SYNOPSIS
function getchar() result(ch)
character(len=1),intent(in) :: ch
integer :: getchar
DESCRIPTION
Read a single character from stdin using the C interface
OPTIONS
|
ch |
A single character to read from stdin
|
|
RETURNS
A integer value for the ADE (ASCII Decimal Equivalent) of the
character, or a negative value if an error occurs.
EXAMPLES
sample usage
program demo_getchar
use M_io, only : getchar, putchar
implicit none
character(len=1) :: byte
integer :: istat
! copy stdin to stdout as a stream one byte at a time
do while (getchar(byte).ge.0)
istat=putchar(byte)
enddo
end program demo_getchar
AUTHOR
John S. Urban
LICENSE
Public Domain
| Nemo Release 3.1 | getchar (3) | June 29, 2025 |
Generated by manServer 1.08 from f646dc67-aa2d-49d8-b13f-c7fbe7f43c10 using man macros.