C++ keypress: getch, cin.get?

前端 未结 6 1144
逝去的感伤
逝去的感伤 2020-12-15 16:48

I have a Win32 program that runs on a loop. I would like to be able to pause that program while awaiting a keypress. It doesn\'t matter whether I use \'any key\' or a specif

6条回答
  •  没有蜡笔的小新
    2020-12-15 16:56

    Assuming that you are looking for an alternative for getch ( which does not echo to screen).

    If you are using windows and visual studio to be precise try using _getch. Here is a link to it http://msdn.microsoft.com/en-us/library/078sfkak(v=VS.100).aspx

提交回复
热议问题