2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
6 .. index:: FPUTC, write character, stream mode, stream mode, write character, file operation, write character
10 FPUTC --- Write a single character in stream mode
11 *************************************************
13 .. function:: FPUTC(UNIT, C)
15 Write a single character in stream mode by bypassing normal formatted
16 output. Stream I/O should not be mixed with normal record-oriented
17 (formatted or unformatted) I/O on the same unit; the results are unpredictable.
20 The type shall be ``INTEGER``.
23 The type shall be ``CHARACTER`` and of default
27 (Optional) status flag of type ``INTEGER``.
28 Returns 0 on success, -1 on end-of-file and a system specific positive
38 .. code-block:: fortran
40 CALL FPUTC(UNIT, C [, STATUS])
41 STATUS = FPUTC(UNIT, C)
44 .. code-block:: fortran
47 CHARACTER(len=10) :: str = "gfortran"
50 OPEN(UNIT = fd, FILE = "out", ACTION = "WRITE", STATUS="NEW")
51 DO i = 1, len_trim(str)
52 CALL fputc(fd, str(i:i))