Manual Reference Pages  - system_getchar (3m_system)

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 (3m_system) March 07, 2025
Generated by manServer 1.08 from 1c477e84-1a75-42a3-9d6a-6f4df4167e56 using man macros.