initscr,是計算機編程的函式語言之一。
基本介紹
- 外文名:initscr
- 函式原型:WINDOW * initscr(void);
- 頭檔案:#include<curses.h>
- 特點:在一個程式中只能調用一次
頭檔案,函式原型,函式說明,範例,
頭檔案
#include<curses.h>
函式原型
WINDOW * initscr(void);
函式說明
範例
[root@localhost chapter06]# cat screen1.c#include <unistd.h>#include <stdlib.h>#include <curses.h>int main() { initscr(); /* We move the cursor to the point (5,15) on the logical screen, print "Hello World" and refresh the actual screen. Lastly, we use the call sleep(2) to suspend the program for two seconds, so we can see the output before the program ends. */ move(5, 15); printf("%s", "Hello World"); refresh(); sleep(2); endwin(); exit(EXIT_SUCCESS);}[root@localhost chapter06]# gcc -o screen1 screen1.c -lcurses[root@localhost chapter06]# ./screen1