You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
442 B
20 lines
442 B
15 years ago
|
#include <ncurses.h>
|
||
15 years ago
|
#include <string.h>
|
||
|
|
||
|
int main()
|
||
|
{
|
||
15 years ago
|
char mesg[] = "Just a string";
|
||
|
int row, col;
|
||
15 years ago
|
|
||
15 years ago
|
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();
|
||
|
|
||
|
return 0;
|
||
15 years ago
|
}
|