如何更新linux console畫面

#include <ncurses.h>
#include <unistd.h>

int main(int argc, char* argv[])
{
    int i = 0;
    initscr();

    for (i = 0; i < 100; i++) {
        mvprintw(1, 5, "%3d", i);
        refresh();
        sleep(1);
    }

    endwin();
    return 0;
}
gcc -g n.c -lcurses

ncurses library

http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/