Lame qstn: console app and keyboard

J

Jan Winnicki

i'm making console app, and its main menu looks like this:

Main menu

Option 1
Option 2
Option 3

user should hit eg 1 on keyboard to choose Option 1 etc

the question is:
what should i use instead of cin, because i dont want users to hit ENTER
after hitting eg 1
 
V

Victor Bazarov

Jan said:
i'm making console app, and its main menu looks like this:

Main menu

Option 1
Option 2
Option 3

user should hit eg 1 on keyboard to choose Option 1 etc

the question is:
what should i use instead of cin, because i dont want users to hit ENTER
after hitting eg 1

There is no answer to your question in terms of the Standard C++ (the only
subject of this newsgroup) because Standard C++ has _no_means_ of keyboard
control. You need to ask in a newsgroup for your OS.

BTW, your question is kind of covered by the FAQ (see section 15). Please
read the FAQ before (or instead of) posting lame qstns.

V
 
P

Phlip

Jan said:
i'm making console app, and its main menu looks like this:

USENET is not chat. Please take the time to write complete words. Don't
write 'qstn' for 'question'.

Next, always use Google.com's Groups page to search for answers first. You
would find the non-Standard header <conio.h>, then you would find that
subsequent discussion of functions like 'getch()' get the best results on
compiler-specific newsgroups. Raw C++ cannot interpret input strings without
an <Enter>.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top