nc4.c (622B)
1 #include <ncurses.h> 2 3 int main(){ 4 initscr(); 5 raw(); // Does NOT let you exit program with Ctrl-C. use cbreak for exit functionality 6 start_color(); 7 init_pair(1, COLOR_RED, COLOR_BLUE); // Corresponds to a pair of colors (foreground, background). 8 attron(COLOR_PAIR(1)); // Set the newly created color pair as attribute 9 printw("It huuuurts!"); // 10 attroff(COLOR_PAIR(1)); 11 12 13 getch(); 14 endwin(); // Frees the memory in the screen and closes ncurses. "destructor" 15 16 return 0; 17 }