Curses is a library of graphic functions widely used under Linux/unix., the function is to be able to draw the user interface and beautiful graphics under DOS.
Curses's name originates from "cursor optimization", which is cursor optimization. It was first written by Bill Joy and Ken Arnold of the University of Berkeley to handle a screen display of a game rogue. Later at Bell Labs, Mark Horton rewritten the curses in System III UNIX. Almost all unix/linux operating systems now have curses libraries, and curses also adds support for the mouse, some menu and panel handling. It can be said that curses is the best choice for Linux Terminal graphics programming (such as the famous text Editor VI is based on the curses series).
Install the Ubuntu installation method: sudo apt-get install Libncurses5-dev usage 1. Include header file: curses.h2. Compile with link statement-lcurses, such as: GCC temp.c-o temp-lcurses sample screen display characters in the middle
#include <curses.h>intMain () {INITSCR (); if(Start_color () = =OK) {Init_pair (1, color_red, Color_green); Attron (Color_pair (1)); Move (LINES/2, cols/2); Waddstr (STDSCR,"yet another Hello world!"); Attroff (Color_pair (1)); Refresh (); Getch (); } Else{waddstr (STDSCR,"Can not init color"); Refresh (); Getch (); } endwin (); return 0;}
Reference:
1. Linux Curses Library use
2. http://tldp.org/howto/ncurses-programming-howto/--"ncurses programming HOWTO"
3. http://invisible-island.net/ncurses/man/ncurses.3x.html--ncurses
Curses library--libncurses5-dev--cursor movement and display of the screen