delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/24/05:31:59

From: "Alberto Chessa" <fiargbgm AT tin DOT it>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Bioskey and Turbo C
Date: 24 Apr 1998 08:32:34 GMT
Organization: FIAR S.p.A.
Lines: 28
Message-ID: <01bd6f5b$9dba9600$92c809c0@CHESSA>
References: <353fae6c DOT 6448359 AT news DOT ncf DOT carleton DOT ca>
Reply-To: "\"Alberto Chessa\" <Alberto Chessa" <fiargbgm AT tin DOT it>
NNTP-Posting-Host: milano19-50.tin.it
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp


Pierre A. Dagenais <dq202 AT freenet DOT carleton DOT ca> wrote in article
<353fae6c DOT 6448359 AT news DOT ncf DOT carleton DOT ca>...
> 
> 
> #ifdef TURBOC
>     k.i = bioskey(0);
> #endif
> 
>  I have a program that compile ok with turboc but acts very strange
> when compiled with DJGPP. The display waits for the enter key to be
> pressed before it shows the prompt. Does anyone know of a difference
> between tc bioskey and djgpp bioskey functions. How to modify so it
> runs as expected?
> your help is appreciated.
> 
I never use TurboC but I suppose that you have to fflush() the stdout prior
to call bioskey() since the level 2 I/O uses buffered I/O (printf() really
send char to the file only when the buffer is full or print a "\n").
Another way is to unbuffered the stdout (see "info libc a setbuf"):
  printf(prompt);  // simple buffer the prompt
  fflush(stdout);	// now print the prompt!
  c=bioskey(0);

Of course, I'm suposing Your are using buffered routine to print the
prompt!

- Raw text -


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