I know that to make a simple yes or no question I can do this:

int Answer;
cin >> Answer;
if (Answer == 1)
{
Response
}
else
{
Response
}

But in the accounting program (In a recent thread), it registered the key before you hit enter.

What code do you have to add/change to make this program to respond instantly after you give a certain input? (pushing 1 and getting the response without having to hit "enter"

Thats what I thought but I can't seem to get any good information on it.

I tried using the source from the program I first saw this command in and it is set up like this:

char ans;
ans=_getch()

but that does not work in my code

Then you need the header file #include <conio.h> and it is getch()

Yep that worked. Thanks!

This question has already been answered. Start a new discussion instead.