2009-11-21 16:00:10 +00:00
|
|
|
#include <ncurses.h>
|
2009-11-19 00:38:43 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2009-11-21 16:00:10 +00:00
|
|
|
char * mesg = "Enter a string: ";
|
|
|
|
char str[80];
|
|
|
|
int row, col;
|
2009-11-19 00:38:43 +00:00
|
|
|
|
2009-11-21 16:00:10 +00:00
|
|
|
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;
|
2009-11-19 00:38:43 +00:00
|
|
|
}
|