On Tue, 25 Aug 1998, James wrote:
> why when i run the following does it wait 5 seconds then display
> ..\.\.\.\.\ instead of displaying . [wait 1 second] \ . [wait 1 second]...
the streams have a little buffer, you can forces a write of all
buffered data of a stream using the fflush(2) function
/* start */
#include <stdio.h>
#include <unistd.h>
int main()
{
int c;
for (c = 0; c < 5; c++) {
printf (".");
sleep (1);
printf ("\\");
fflush(stdout); # flushes the standard out stream
}
return 0;
}
/* end */
now works! :)
regards,
Augusto Cesar <[EMAIL PROTECTED]>
---------------------------------