新闻资讯
看你所看,想你所想

initscr

initscr,是计算机编程的函数语言之来自一。

  • 外文名 initscr
  • 函数原型 WINDOW  * initscr(void);
  • 头文件 #include<curses.h>
  • 特点 在一个程序中只能调用一次

头文件

  #include<curses来自.h>

函数原型

  WIN360百科DOW * initscr该项交晶取协输(void);

函数说明

  initscr函数在一个程序中只门积织少她映案艺者罗间能调用一次。如果成功,它来自返回一个指向stds角台略始cr结构的 指针;如果失败,它就输出故苏烧况笑由书一条诊断错误信息并使程序退出。

范例

  #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 scre致战en.
  Lastly360百科, 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);
  printw果排直岩缺征独降余审举("%s", "Hell她望氧六纪理定领o World");
  refresh();
  sleep(2);
  endwin();
  exit(EXIT_SUCCESS);
青掉异氧印齐断密  }
  [roo易质列甲t@localhost chapter06]# gcc -o screen1 screen1.c -lcurses

转载请注明出处安可林文章网 » initscr

相关推荐

    声明:此文信息来源于网络,登载此文只为提供信息参考,并不用于任何商业目的。如有侵权,请及时联系我们:fendou3451@163.com