int main()
{
initscr();
start_color(); //to add color effect
init_pair(1,COLOR_GREEN,COLOR_BLUE); //declaring color(<pair no>,<text color>,
<background color>)
attrset (COLOR_PAIR(1)); //set the colors
move(12,30);
printw("My first color prog");
getch();
endwin();
return 0;
}
The compilation of the above program....
g++ -o<the name that you want compile> <file name> -lncurses
No comments:
Post a Comment