How do I go about reading in a character value without the user having to press enter?
Thank you for your help,
Daniel
Printable View
How do I go about reading in a character value without the user having to press enter?
Thank you for your help,
Daniel
Code:#include <iostream.h>
int main(void)
{
char C;
cout << "Please enter char: ";
cin >> C;
cout << "\n" << C;
cin.get() //hold screen
return 0;
}
Using standard functions, you cannot.Quote:
Originally posted by Daniel
How do I go about reading in a character value without the user having to press enter?
Thank you for your help,
Daniel
Read: http://www.parashift.com/c++-faq-lit...html#faq-15.17
However, if your compiler has conio.h you could use getch() or one of its equivalents.
ooops missed that bitsorryQuote:
having to press enter