Hi all,

I program in C++ for leisure. Any C++ programmers on the list: i've been 
attempting to make it so that when a user is asked for input, and they enter a 
single character, then the program continues. Let me try and explain.

Say I make a program and it presents the user with a menu of choices (a console 
program). (options a, b, c, d, etc). I want it so that it reads a single 
character and then does something with it, without waiting for the enter key. 
Here's a program I've made, just to see if it works. I'm having trouble 
compiling. I'm using Dev C++ on Windows. I didn't do <iostream.h> I just did 
<iostream> also I just did <conio> rather than <conio.h> when including the 
appropriate header files

Thanks!

#include <conio>
#include <iostream>

using namespace std;

int main()
{
char blabla;
cout<<"Enter a character, any character!\n";
blabla = getch();
cout<<"Thanks, quitting now.\n";
system("pause");
return 0;
}



Any help is greatly appreciated in advance.
For answers to frequently asked questions about this list visit:
http://www.jaws-users.com/help/

Reply via email to