Thread: AW: [Dev-C++] character input without keyboard echo
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Kluck, S. <Ste...@Dr...> - 2001-02-28 17:34:01
|
tried it - does not work for getchar(), but for later calls of printf = :-( Stephan Stephan Kluck > Advance Bank AG > Gesch=E4ftsfeld: Dresdner Direktservice > DV-Systeme > email: Ste...@Dr...=20 > voice: +49 (0) 203 3047-2474 > fax: +49 (0) 203 3047-3555 >=20 Bitte haben Sie Verst=E4ndnis, dass diese E-Mail keinen = rechtsverbindlichen Charakter hat. Please note that this email is not legally binding. > -----Urspr=FCngliche Nachricht----- > Von: Ioannis Vranos [SMTP:no...@ya...] > Gesendet am: Mittwoch, 28. Februar 2001 18:21 > An: dev...@li... > Betreff: RE: [Dev-C++] character input without keyboard echo >=20 > fclose(stdout); > ... >=20 >=20 > Ioannis >=20 > * Ioannis Vranos > * Programming pages: http://members.nbci.com/noicys > * Alternative URL: http://run.to/noicys >=20 >=20 > > -----Original Message----- > > From: dev...@li... > > [mailto:dev...@li...]On Behalf Of > > Kluck, Stefan > > Sent: Wednesday, February 28, 2001 5:53 PM > > To: 'dev...@li...' > > Subject: [Dev-C++] character input without keyboard echo > > > > > > How can I use getc or getchar without having the characters = displayed on > > the screen? > > > > Thanks, Stephan > > > > > > Stephan Kluck > > > Advance Bank AG > > > Gesch=E4ftsfeld: Dresdner Direktservice > > > DV-Systeme > > > email: Ste...@Dr... > > > voice: +49 (0) 203 3047-2474 > > > fax: +49 (0) 203 3047-3555 > > > > > Bitte haben Sie Verst=E4ndnis, dass diese E-Mail keinen > rechtsverbindlichen > > Charakter hat. > > Please note that this email is not legally binding. > > > > > > > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > >=20 >=20 > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Kluck, S. <Ste...@Dr...> - 2001-02-28 19:40:51
|
tried getch(), but *does* echo to the screen (Dev-C++ 4.01, Windows NT = 4.0 SP5) :-( Stephan Stephan Kluck > Advance Bank AG > Gesch=E4ftsfeld: Dresdner Direktservice > DV-Systeme > email: Ste...@Dr...=20 > voice: +49 (0) 203 3047-2474 > fax: +49 (0) 203 3047-3555 >=20 Bitte haben Sie Verst=E4ndnis, dass diese E-Mail keinen = rechtsverbindlichen Charakter hat. Please note that this email is not legally binding. > -----Urspr=FCngliche Nachricht----- > Von: Robert D BAugh [SMTP:lon...@ju...] > Gesendet am: Mittwoch, 28. Februar 2001 20:06 > An: dev...@li... > Betreff: Re: [Dev-C++] character input without keyboard echo >=20 > Use getch(); >=20 > It does not echo to the screen. >=20 > lonestar26 > On Wed, 28 Feb 2001 16:52:56 +0100 "Kluck, Stefan" > <Ste...@Dr...> writes: > > How can I use getc or getchar without having the characters = displayed=20 > > on > > the screen? > >=20 > > Thanks, Stephan > >=20 > >=20 > > Stephan Kluck > > > Advance Bank AG > > > Gesch=E4ftsfeld: Dresdner Direktservice > > > DV-Systeme > > > email: Ste...@Dr...=20 > > > voice: +49 (0) 203 3047-2474 > > > fax: +49 (0) 203 3047-3555 > > >=20 > > Bitte haben Sie Verst=E4ndnis, dass diese E-Mail keinen=20 > > rechtsverbindlichen > > Charakter hat. > > Please note that this email is not legally binding. > >=20 > >=20 > >=20 > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users > >=20 >=20 > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
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
|
|
From: Kluck, S. <Ste...@Dr...> - 2001-02-28 20:58:38
|
That works great, Ioannis!
Thank you very much,
Stephan
Stephan Kluck
> Advance Bank AG
> Gesch=E4ftsfeld: Dresdner Direktservice
> DV-Systeme
> email: Ste...@Dr...=20
> voice: +49 (0) 203 3047-2474
> fax: +49 (0) 203 3047-3555
>=20
Bitte haben Sie Verst=E4ndnis, dass diese E-Mail keinen =
rechtsverbindlichen
Charakter hat.
Please note that this email is not legally binding.
> -----Urspr=FCngliche Nachricht-----
> Von: Ioannis Vranos [SMTP:no...@ya...]
> Gesendet am: Mittwoch, 28. Februar 2001 21:45
> An: dev...@li...
> Betreff: RE: [Dev-C++] character input without keyboard echo
>=20
> 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:
>=20
> #include <conio.h>
>=20
> int main()
> {
> char c=3Dgetch();
>=20
> }
>=20
> 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):
>=20
> #include <stdio.h>
> #include <conio.h>
>=20
> char clean_getch(void)
> {
> char c=3Dgetche();
> printf("\b \b");
>=20
> return c;
> }
>=20
>=20
> Ioannis
>=20
> * Ioannis Vranos
> * Programming pages: http://members.nbci.com/noicys
> * Alternative URL: http://run.to/noicys
>=20
>=20
>=20
> > -----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
>=20
>=20
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|