www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/24/02:02:14

From: "LJ" <stud3863@"nospam_s"student.uib.no>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: getch() getche()
Date: 24 Aug 1998 05:57:23 GMT
Organization: University of Bergen, Norway
Lines: 45
Message-ID: <01bdcec2$4bfa15e0$LocalHost@alf.uib.no>
References: <01bdcdf6$1f096440$LocalHost AT alf DOT uib DOT no> <35e03b3e DOT 0 AT newsread1 DOT dircon DOT co DOT uk>
NNTP-Posting-Host: oppringt-248.ppp.uib.no
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019