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) February 23, 2025
Generated by manServer 1.08 from c80d608e-fad5-419b-bfb2-9717e1dc5cc2 using man macros.