Source Code File 06-01_text1

06-01_text1.c

#include <ncurses.h>

int main()
{
    char text1[] = "This is the first line\n";
    char text2[] = "Line two here\n";
    char text3[] = "The third line\n";
    char text4[] = "Fourth line here\n";
    char text5[] = "And the fifth line\n";
    
    initscr();
    
    addstr(text1);
    addstr(text3);
    addstr(text5);
    refresh();
    getch();
    
    endwin();
    return(0);
}

Output Screenshot

Notes

* In my original Ncurses book, I used text from Shakespeare for this chapter's example. The problem with that text is that it would wrap in the eBook and look ugly on the page. So I created my own epic poetry.