/* * Compile with gcc test-curses.c -lncurses -o test-curses -g */ #include #include #include int main(void) { int y, x; WINDOW *window; initscr(); cbreak(); noecho(); clear(); y = LINES / 3; x = COLS / 3; char* box = "**********\n++++++++++\n##########\0"; char* box_copy; window = subwin(stdscr, 3, 11, 3, 3); while (1) { box_copy = malloc(strlen(box)); box_copy = strcpy(box_copy, box); clear(); mvwaddstr(window, 0, 0, (const char*)box_copy); getch(); } endwin(); return 0; }