C Library Functions  - system_getchar (3)

NAME

system_getchar(3f) - [M_system:IO] reads a character from the stdin stream. (LICENSE:PD)

CONTENTS

Synopsis
Description
Return Value
Examples

SYNOPSIS

integer(kind=c_int) function system_getchar(ch)

     character(len=1),intent(out) :: ch

DESCRIPTION

system_getchar(3f) read the character CH from the stdin stream via C I/O.

RETURN VALUE

If an error occurs the return value is negative. Otherwise getchar(3C) returns the character read as a default integer value that is the ADE (ASCII Decimal Equivalent) of the character.

In addition, the option CH contains the character read.

EXAMPLES

Example program

   program demo_system_getchar
   use M_system, only : system_getchar, system_putchar
   implicit none
   character(len=1) :: ch
   integer :: iostat
   integer :: icount
   icount=0
   ! copy first 1024 characters from stdin to stdout
      do while(system_getchar(ch).ge.0)
         iostat=system_putchar(ch)
         icount=icount+1
         if(icount > 1024 ) exit
      enddo
   end program demo_system_getchar


Nemo Release 3.1 system_getchar (3) August 28, 2026
Generated by manServer 1.08 from 7df320e2-3d43-4b45-a18a-2a37ad99e36c using man macros.