Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a standard getch() equivalent in C++?

Tags:

c++

I know that getch is not a standard C/C++ function but I tend to like it because it doesn't need you to press enter before returning. So I'd like to know if there is any equivalent in standard C++ that has the same effect (doesn't require you to press enter)?

I have read similar questions on this site but none of their answers say whether there is a standard and portable equivalent or not.

like image 562
Mo Sanei Avatar asked Jul 22 '13 11:07

Mo Sanei


1 Answers

There is a portable-ish equivalent if you use one of the "curses" libraries, such as ncurses

like image 97
Mats Petersson Avatar answered Sep 28 '22 06:09

Mats Petersson