请问C语言是怎样做到getch()函数的?谢谢! 如题,请给出程序代码,谢谢!马上结帖! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 #include <conio.h>#include <ctype.h>void main( void ){ int ch; _cputs( "Type 'Y' when finished typing keys: " ); do { ch = _getch(); ch = toupper( ch ); } while( ch != 'Y' ); _putch( ch ); _putch( '\r' ); /* Carriage return */ _putch( '\n' ); /* Line feed */} 呵呵,是使用汇编写的,汇编可以直接与键盘中断打交道,所以实现getch()易如反掌。 再请问一下,在VxWorks中是如何实现getch()函数的,对解决该问题的哥们将另开一百分! CRT目录下有getch.c,里边的_getch有源码 c++ URLEncode返回乱码 VC MFC 内存泄漏问题 今天辞职了,过几天去新公司报到。 关于operator new 关于ssl中证书和公钥的问题 函数指针问题... 上面圆角,下面方角的窗口怎么做的? 奇怪的小问题!服务端发送消息时总是会莫名其妙多发一条乱码消息!(在线等待!) 线程与端口 MFC建立的三种dll有何区别?(80分) 请教网络编程手把手式入门书籍 如何在VC中设置版本信息?
#include <ctype.h>void main( void )
{
int ch; _cputs( "Type 'Y' when finished typing keys: " );
do
{
ch = _getch();
ch = toupper( ch );
} while( ch != 'Y' ); _putch( ch );
_putch( '\r' ); /* Carriage return */
_putch( '\n' ); /* Line feed */
}