Mail Archives: djgpp/1998/08/24/02:02:14
Hello Sidd,
I've tried with and without conio.h, and the results is not what I
expected. Maybe I've have totally misunderstood what these functions
(getch( ) getche( )) can do for me... .
Please try these little program (and of cause if you've not already have
tried other more advanced programs) and see what results you get. The line
in 'cout' don't show before I press a character.
LJ
=========================================
#include <iostream.h>
#include <conio.h>
main()
{
char Ch;
cout << "Write a character: ";
Ch = getch();
cout << endl << "You wrote: " << Ch << endl;
cout << "Write a new character: ";
Ch = getche();
cout << endl << "You wrote: " << Ch << endl;
}
=========================================
Siddiqui <siddiqui AT dircon DOT co DOT uk> wrote in article
<35e03b3e DOT 0 AT newsread1 DOT dircon DOT co DOT uk>...
> >I've tryed including <conyo.h> so I could use the 'getch()' 'getche()'
> >(originally from Borland C++) functions in some simple programs. I don't
> >think the programs work as they should.
>
>
> 1. shouldn't that be conio.h?
>
> 2. If you're using Rhide you don't need to include conio.h (I don't
even
> think it's the headerfile that helps use these types of functions). Just
> choose "use standard libs" at the bottom of the "libraries" form whch can
be
> selected from Options/libraries/
>
>
>
- Raw text -