Skip to content
← Back to Community
c++ get input without enter
Profile icon
AdobeZev

I am trying to get a keystroke but both cin and getline() aren't working.
I've tried getch() with #include<curses.h> but that also doesn't work (Or at least I don't understand it) Could someone help me?

Voters
Profile icon
AdobeZev
Comments
hotnewtop
Profile icon
Highwayman

Please send the code, we can probably show you what’s wrong.

Profile icon
AdobeZev
Profile icon
dreamrOfficial

Are you using the correct headers?

Profile icon
SamuelPKuld

Do you mean when the user inputs something, it will immediately assign it to a variable?

Profile icon
SamuelPKuld

(without pressing enter)@TheFlooBearer

Profile icon
AdobeZev
Profile icon
SamuelPKuld

http://www.cplusplus.com/forum/general/29137/
This is the most I could find on the subject.. I am not familiar with the library. So, you'd be on your own with that.
@AdobeZev