等待键盘输入? [英] wait for keyboard entry ?

查看:88
本文介绍了等待键盘输入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


又是我了...... Pelo,还有其他初学者的问题...


什么代码应该是用C ++来等待键盘输入才能执行我的程序的等价...


Hi everybody,

It''s me again...Pelo, for an other beginner question...

What the code should be in C++ to wait for a keyboard entry in order to
execute the sequal of my program...


推荐答案

我自己找到了...


#include< conio.h>

cout<< ; 按任意键终止此程序。 " ; getch();


getch()函数调用导致程序等待一次击键。


" Pelo GANDO" < O0 **** @ hotmail.com> écritdansle message de news:

c2 ********** @ news-reader3.wanadoo.fr ...
I found by myself...

#include <conio.h>
cout << "Press any key to terminate this program. " ; getch();

The getch() function call causes the program to wait for a single keystroke.

"Pelo GANDO" <o0****@hotmail.com> a écrit dans le message de news:
c2**********@news-reader3.wanadoo.fr...
大家好,

这又是我...... Pelo,对于另一个初学者的问题...

C ++中的代码应该是等待键盘输入以便
执行我的程序的等级...
Hi everybody,

It''s me again...Pelo, for an other beginner question...

What the code should be in C++ to wait for a keyboard entry in order to
execute the sequal of my program...



" Pelo GANDO" < O0 **** @ hotmail.com>在消息中写道

news:c2 ********** @ news-reader5.wanadoo.fr ...
"Pelo GANDO" <o0****@hotmail.com> wrote in message
news:c2**********@news-reader5.wanadoo.fr...
我自己找到了......

#include< conio.h>
cout<< 按任意键终止此程序。 " ; getch();

getch()函数调用导致程序等待单个
I found by myself...

#include <conio.h>
cout << "Press any key to terminate this program. " ; getch();

The getch() function call causes the program to wait for a single



击键。


但是它不是C ++语言的一部分。这是你的实施提供的一个

''扩展'',而不是这里的主题

。在这里我们讨论ISO标准C ++语言,

无法做你想要的。


见:
http://www.slack.net/~shiva/welcome.txt


-Mike


keystroke.

But alas it''s not part of the C++ language. It''s an
''extension'' provided by your implementation, not topical
here. Here we discuss the ISO standard C++ langauge, which
has no means to do what you''re asking.

See:
http://www.slack.net/~shiva/welcome.txt

-Mike


谢谢!

" Mike Wahler" < MK ****** @ mkwahler.net> écritdansle message de news:

5X******************@newsread1.news.pas.earthlink。 net ...
thank you !
"Mike Wahler" <mk******@mkwahler.net> a écrit dans le message de news:
5X******************@newsread1.news.pas.earthlink. net...
" Pelo GANDO" < O0 **** @ hotmail.com>在消息中写道
新闻:c2 ********** @ news-reader5.wanadoo.fr ...
"Pelo GANDO" <o0****@hotmail.com> wrote in message
news:c2**********@news-reader5.wanadoo.fr...
我自己找到了...

#include< conio.h>
cout<< 按任意键终止此程序。 " ; getch();

getch()函数调用导致程序等待单个
I found by myself...

#include <conio.h>
cout << "Press any key to terminate this program. " ; getch();

The getch() function call causes the program to wait for a single


按键。

但是唉它是'不属于C ++语言。这是你的实施提供的一个
''扩展',而不是局部的
。在这里,我们讨论ISO标准C ++语言,它无法满足您的要求。

请参阅:
http://www.slack.net/~shiva/welcome.txt
-Mike


keystroke.

But alas it''s not part of the C++ language. It''s an
''extension'' provided by your implementation, not topical
here. Here we discuss the ISO standard C++ langauge, which
has no means to do what you''re asking.

See:
http://www.slack.net/~shiva/welcome.txt

-Mike



这篇关于等待键盘输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆