|
From: Ricardo R. <ri...@po...> - 2002-03-28 17:40:06
|
Finally I have found three different ways
to implement the reading of a key without pressing RETURN.
I report them if it can be of help for somebody.
It works finely on my platform, but as it has been discussed
in the last days, it is not sure that it runs well
on other installations of Dev-C++.
Ricardo.
*******************************************
#include <iostream>
#include <conio_mingw.h>
int main()
{
cout << "Enter any key." << endl;
getch(); //reads a char without return and without echo
cout << "Enter another key" << endl;
getche(); // reads a char without return and with echo
cout << "\n End is coming...Press a key" << endl;
while(!kbhit()) ; // waits until you press a key
return(0);
}
********************************************
|