system_putchar(3f) - [M_system:IO] writes a character to the stdout stream. (LICENSE:PD)
Synopsis
Description
Return Value
Examples
integer(kind=c_int) function system_putchar(ch)
character(len=1),intent(in) :: ch
system_putchar(3f) writes the character CH to the stdout stream via C I/O by passing the character on to putchar(3c).
A negative value is returned on error. Otherwise putchar(3f) returns a default integer with the ADE (ASCII Decimal Equivalent) of the character written.
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_putcharResults:
> !"#$%&()*+,-./012 > 3456789:;<=>?@ABCDE > FGHIJKLMNOPQRSTUVWX > YZ[\]^_abcdefghijk > lmnopqrstuvwxyz{|}~ >
Nemo Release 3.1 | system_putchar (3m_system) | March 07, 2025 |