Mail Archives: djgpp/1998/04/24/05:31:59
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 -