getline()和cin()都要求用户输入完后打一回车,我现在只要输入一个字符,有什么办法让用户不打回车,一按键就完成输入?类似于Press any 类似于Press any key to continue. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 /* GETCH.C: This program reads characters from * the keyboard until it receives a 'Y' or 'y'. */#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 */} 关于GetDocument()的一个问题 关于查找对话框的问题,请教 twain的下载地址 Slider 控件SDK方式 - 响应消息再问 在一个自定义函数内,打开、修改,并显示文本的问题。 将CXXXAPP中的代码移到CXXXDOC中?? vc中的dbgrid控件! connect函数的调用 我以后再也不在 灌水乐园 之外的地方灌水了! 让我们大家把CSDN建设得更好吧! 把3个16进制,合并成字符串 怎样将一个char*p, p所指向的内容以字节的方式写在文件里???? 关于IE
* the keyboard until it receives a 'Y' or 'y'.
*/#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 */
}