Quick C Stream Flushing
iroberts at g.adelaide.edu.au
iroberts at g.adelaide.edu.au
Wed Feb 13 13:30:56 AEST 1991
Help!
I have a programme written in Microsoft Quick C.
It compiles and runs OK on my PC but is very slow due to unnecessary disk
operations.
The programme receives keyboard input performs some simple calculations then
writes the results to disk using fprintf. I have attempted to adjust BUFFERS so
that a complete record can be held in memory. I have used fflush to flush the
stream to disk at the end of one set of records.
This works fine on the first pass through this loop but on subsequent passes the
stream is flushed much more often. It seems to be flushed when the following
functions are called:
system("cls");
flush(stdin);
I cannot understand why this occurs.
More information about the Comp.lang.c
mailing list