WINDOWS操作系統(tǒng):
//---------------------------------------------------------------------------
#include<stdio.h>
#include<conio.h>
intmain(void)
{
charc;
while((c=getch())!='q')
putchar('*');
return0;
}
//---------------------------------------------------------------------------
LINUX操作系統(tǒng):
//---------------------------------------------------------------------------
#include<curses.h>
intmain(void)
{
initscr();
cbreak();
noecho();
while(getch()!='q')addch('*');
echo();
nocbreak;
endwin();
return0;
}
/*編譯時(shí)要加上-lcurses參數(shù)*/
//---------------------------------------------------------------------------