Microsoft C,printf(), ansi,sys

Roger House roger at everexn.uucp
Sat Jun 2 03:59:12 AEST 1990


In <1479.26641e4f at miavx1.acs.muohio.edu> jfeldhouse at miavx1.acs.muohio.edu writes:

>While using Microsoft C 5.1 I discovered
>that anything I tried to print to the screen
>using printf() didn't appear unless the
>machine was using ansi.sys as a device driver.

>Is this normally the case? or did I compile wrong?

>Things that I sent to the screen using interupt 07
>worked fine. Things using printf() didn't show up.

>please just mail me your suggestions
>and thanks in advance

>Jim Feldhouse


I tried mailing this several times, but it didn't work.

The output from printf is buffered.  It does not go to the screen until
the buffer is full or the file is closed.  To force the current buffer
contents to the screen use fflush(stdout).  Thus, if you follow each printf
with fflush, you will get what you want.  (ansi.sys is not needed).
                                                    Roger House



More information about the Comp.lang.c mailing list