hello2.c

来自「understanding unix/linux programming sou」· C语言 代码 · 共 28 行

C
28
字号
/* hello2.c *	purpose	 show how to use curses functions with a loop  *	outline	 initialize, draw stuff, wrap up */#include	<stdio.h>#include	<curses.h>main(){	int	i;	initscr();			/* turn on curses	*/	   clear();			/* draw some stuff	*/	   for(i=0; i<LINES; i++ ){		/* in a loop	*/		move( i, i+i );		if ( i%2 == 1 )			standout();		addstr("Hello, world");		if ( i%2 == 1 )		       standend();	   }	   refresh();			/* update the screen	*/	   getch();			/* wait for user input	*/	endwin();			/* reset the tty etc	*/}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?