Generates a printable representation of a character.
Curses Library (libcurses.a)
#include <curses.h>
char *unctrl
(chtype c);
The unctrl subroutine generates a character string that is a printable representation of c. If c is a control character, it is converted to the ^X notation. If c contains rendition information, the effect is undefined.
Item | Description |
---|---|
c |
Upon successful completion, the unctrl subroutine returns the generated string. Otherwise, it returns a null pointer.
To display a printable representation of the newline character, enter:
char *new_line;
int my_character;
addstr ("Hit the enter key.");
my_character=getch();
new_line=unctrl (my_character);
printw (Newline=%s", new_line);
refresh();
This prints, "newline=^J".