Mail Archives: djgpp/1998/01/26/04:00:40
In article <34cc2c99 DOT 1842074 AT news DOT telusplanet DOT net>, tg
<tgamblin AT telusplanet DOT net> writes
> Whenever I have a printf before a getch, it waits until a key is
>pressed before printing the string. However, if the string ends with a
>\n it works fine.
>
>e.g printf("blah");
> getch();
>
>will wait for a key to be pressed and then print "blah". If I replace
>it with "blah\n" it works.
>
> Is this supposed to happen and if so how do I get around it? I've
>tried the same thing with a borland compiler and it works as expected.
>
Try fflush(stdout).
Leon
--
Leon Heller: leon AT lfheller DOT demon DOT co DOT uk http://www.lfheller.demon.co.uk
Amateur Radio Callsign G1HSM Tel: +44 (0) 118 947 1424
See http://www.lfheller.demon.co.uk/dds.htm for details of my AD9850
DDS system. See " "/diy_dsp.htm for a simple DIY DSP ADSP-2104 system.
- Raw text -