diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -1,4 +1,5 @@ #include <ncurses.h> +#include <string.h> void hello_world() { initscr(); @@ -8,8 +9,22 @@ void hello_world() { endwin(); } +void printw_example(){ + char mesg[]="Just a string"; + int row,col; + initscr(); + getmaxyx(stdscr,row,col); + mvprintw(row/2, (col-strlen(mesg))/2, "%s", mesg); + mvprintw(row-2, 0, "this screen has %d rows and %d columns\n",row,col); + printw("Try resizing your window (if possible) and then run this program again"); + refresh(); + getch(); + endwin(); +} + int main(int argc, const char *argv[]) { hello_world(); + printw_example(); return 0; } |
