Install sudo apt-Get install libncurses5-dev
GCC 1.C-o t-lncurses (-L is indispensable)
The following content is from beginning Linux Programming
# Include <stdio. h>
# Include <unistd. h>
# Include <stdlib. h>
# Include <string. h>
# Include <curses. h>
Int main ()
{
Const char witch_one [] = "first witch ";
Const char witch_two [] = "second witch ";
Const char * scan_ptr;
Initscr ();
Move (5, 15 );
Attron (a_bold );
Printw ("% s", "Macbeth ");
Attroff (a_bold );
Refresh ();
Sleep (1 );
Move (8, 15 );
Attron (a_standout );
Printw ("% s", "thunder and lightning ");
Attroff (a_standout );
Refresh ();
Sleep (1 );
Move (10, 10 );
Printw ("% s", "When shall we three meet again ");
Move (11,23 );
Printw ("% s", "In thunder, lightning, or in rain? ");
Move (13, 10 );
Printw ("% s", "when the hurlyburly's done ,");
Move (14,23 );
Printw ("% s", "when the battle's lost and won .");
Refresh ();
Sleep (1 );
Attron (a_dim );
Scan_ptr = witch_one + strlen (witch_one)-1;
While (scan_ptr! = Witch_one)
{
Move (10, 10 );
Insch (* scan_ptr --);
}
Scan_ptr = witch_two + strlen (witch_two)-1;
While (scan_ptr! = Witch_two)
{
Move (13, 10 );
Insch (* scan_ptr --);
}
Attroff (a_dim );
Refresh ();
Sleep (1 );
Move (lines-1, cols-1 );
Refresh ();
Sleep (1 );
Endwin ();
Exit (0 );
}