addch
SYNOPSIS
#include <ocurses.h>
int addch(ch)
chtype ch;
NOTES
-
addch writes a single character to stdscr and advances the cursor to the next character position.
-
The character is of the type chtype, which is defined in ocurses.h.
chtype contains data and attributes
(see
``Output attributes''
for information about attributes).
-
When working with variables of this type,
make sure you declare them as chtype and not
as the basic type (for example, unsigned long)
that chtype is declared to be in ocurses.h.
This will ensure future compatibility.
-
addch does some translations.
For example, it converts
-
the <NL> character to a clear to end of line and a move to the next line
-
the tab character to an appropriate number of blanks
-
other control characters to their ^X notation
-
addch normally returns COK.
The only time addch returns ERR
is after adding a character to the lower right-hand corner
of a window that does not scroll.
-
addch is a macro.
EXAMPLE
#include <ocurses.h>
main()
{
initscr();
addch('a');
refresh();
endwin();
}
The output from this program will appear as follows,
with a in position 0, 0:
a
$[]
See also
``The show program''.
Next topic:
addstr
Previous topic:
Output
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004