RE: [Dev-C++] character input without keyboard echo
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ya...> - 2001-02-28 20:42:26
|
He speaks about getch() declared in conio.h . getch() does not belong to the
standard C but is a platform extension. Use it in this way:
#include <conio.h>
int main()
{
char c=getch();
}
I saw that in Dev-C++ it has output to the screen where usually in other
compilers it does not. The only thing which is 100% is that standard C does
not provide you with input function from keyboard which has no "feedback" on
thee screen. Also about the thing i told before about fclose(stdout); was a
mistake.
Here is a solution for your case on Dev-C++ (and probably working in many
others Windows C/C++ compilers):
#include <stdio.h>
#include <conio.h>
char clean_getch(void)
{
char c=getche();
printf("\b \b");
return c;
}
Ioannis
* Ioannis Vranos
* Programming pages: http://members.nbci.com/noicys
* Alternative URL: http://run.to/noicys
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...]On Behalf Of
> Kluck, Stefan
> Sent: Wednesday, February 28, 2001 9:42 PM
> To: 'dev...@li...'
> Subject: AW: [Dev-C++] character input without keyboard echo
>
>
> tried getch(), but *does* echo to the screen (Dev-C++ 4.01, Windows NT 4.0
> SP5)
> :-(
>
> Stephan
|