[ Character I/O | Reference Manual | Alphabetic Index ]

put_char(+Stream, +Char)

Puts the single character string Char onto the buffered output stream Stream.
Stream
Integer (stream number) or Atom (reserved or user-defined symbolic stream name).
Char
Single character string.

Description

Puts the single-character string Char onto the output stream Stream.

Modes and Determinism

Exceptions

(4) instantiation fault
Stream is not instantiated.
(4) instantiation fault
Char is not instantiated.
(5) type error
Stream is neither an integer nor an atom.
(5) type error
Char is instantiated, but not to a single character string.
(192) illegal stream mode
Stream is not an output stream.
(193) illegal stream specification
Stream is an illegal stream specification.

Examples

Success:
  [eclipse]: put_char(output, "a").
  a
  yes.

  [eclipse]: get_char(input,C),put_char(output,C).
  > a
  a
  C = "a"
  yes.
Error:
  put_char(Stream,A).      (Error 4).
  put_char(output,a).      (Error 5).
  put_char(output,98).     (Error 5).
  put_char(11, "a").        (Error 192).
  put_char(atom, "a").      (Error 193).



See Also

get_char / 1, get_char / 2, put_char / 1, nl / 1