Home

Fprintw

Fprintw is a function in the ncurses library that outputs formatted text to a FILE pointer, integrating the printf-like formatting conventions of ncurses text output. It is part of the ncurses family of print-style functions and provides a means to produce formatted output to standard file streams, not just to on-screen windows.

The function signature is int fprintw(FILE *stream, const char *fmt, ...). It formats the input according to

Fprintw belongs to the print family in ncurses, which also includes printw (to the stdscr window), mvprintw

Usage considerations: like other ncurses functions, fprintw is intended for use within a curses-enabled environment; initialization

Availability: fprintw is part of the ncurses library and is available on Unix-like systems and Windows ports

fmt
and
writes
the
result
to
the
specified
stream.
The
return
value
is
the
number
of
characters
printed,
or
ERR
on
error,
following
the
general
error
convention
used
by
ncurses.
The
format
specifiers
follow
those
of
standard
printf.
(move
then
print),
wprintw
(print
to
a
WINDOW),
and
mvwprintw
(move
within
a
WINDOW
then
print).
Fprintw,
by
contrast,
redirects
output
to
a
FILE*
stream
rather
than
a
curses
window,
making
it
suitable
for
logging,
exporting
text,
or
capturing
formatted
output
produced
by
a
curses-based
program.
of
the
curses
library
is
typically
required.
Its
behavior
outside
a
curses
session
is
not
portable.
It
is
commonly
employed
for
debugging,
reporting,
or
persisting
textual
data
generated
by
a
curses-driven
interface.
that
provide
ncurses
functionality
(such
as
PDCurses).