|
发表于 2003-2-20 15:50:32
|
显示全部楼层
man getchar
最初由 david yang 发布
那请问有什么同样功能的函数可以让我接受一个从键盘输入的字符???
#include<iostream.h>
#include<conio.h>
void main()
{
cout<<" lease input the b key to hear a bell.\n";
char ch=getche();
if(ch=='b')
cout<<'\a';
else
if (ch=='\n')
cout<<"what a boring select on...\n";
else
cout<<"bye!\n";
} |
|