diff --git a/basics/scanw_example.c b/basics/scanw_example.c index 4a91faf..a81f053 100644 --- a/basics/scanw_example.c +++ b/basics/scanw_example.c @@ -1,20 +1,19 @@ -#include /* ncurses.h includes stdio.h */ +#include #include int main() { - char mesg[]="Enter a string: "; /* message to be appeared on the screen */ - char str[80]; - int row,col; /* to store the number of rows and * - * the number of colums of the screen */ - initscr(); /* start the curses mode */ - getmaxyx(stdscr,row,col); /* get the number of rows and columns */ - mvprintw(row/2,(col-strlen(mesg))/2,"%s",mesg); - /* print the message at the center of the screen */ - getstr(str); - mvprintw(LINES - 2, 0, "You Entered: %s", str); - getch(); - endwin(); + char * mesg = "Enter a string: "; + char str[80]; + int row, col; - return 0; + initscr(); + getmaxyx(stdscr, row, col); + mvprintw(row / 2, (col - strlen(mesg)) / 2, "%s", mesg); + getstr(str); + mvprintw(LINES - 2, 0, "You Entered: %s", str); + getch(); + endwin(); + + return 0; }