C Library Functions - system_putchar (3)
NAME
system_putchar(3f) - [M_system:IO] writes a character to the stdout stream.
(LICENSE:PD)
CONTENTS
Synopsis
Description
Return Value
Examples
SYNOPSIS
integer(kind=c_int) function system_putchar(ch)
character(len=1),intent(in) :: ch
DESCRIPTION
system_putchar(3f) writes the character CH to the stdout stream via C I/O
by passing the character on to putchar(3c).
RETURN VALUE
A negative value is returned on error. Otherwise putchar(3f) returns
a default integer with the ADE (ASCII Decimal Equivalent) of the
character written.
EXAMPLES
Example program
program demo_system_putchar
use M_system, only : system_putchar
implicit none
integer :: i, j
integer :: iostat
j=0
do i=32,126 ! printable ASCII characters
iostat=system_putchar(achar(i))
if(iostat.lt.0)stop <ERROR> *main* character //achar(i)
j=j+1
if(j.ge.19)then
iostat=system_putchar(new_line(a))
j=0
endif
enddo
iostat=system_putchar(new_line(a))
end program demo_system_putchar
Results:
> !"#$%&()*+,-./012
> 3456789:;<=>?@ABCDE
> FGHIJKLMNOPQRSTUVWX
> YZ[\]^_abcdefghijk
> lmnopqrstuvwxyz{|}~
>
| Nemo Release 3.1 | system_putchar (3) | June 29, 2025 |
Generated by manServer 1.08 from 83f08ee7-c09a-41cc-a204-d1d0892e5116 using man macros.