Z
zerotypeepytorez
Hi,
I was recently writing a couple of functions to distribute on
comp.sys.sinclair. My code included the use of fflush(stdout) after
some of the output statements (I was using stdio.h instead of iostream
to cater for rather old compilers without an iostream equivalent to
the gets() function, but if anyone answers this I'd like to know if
their answer applies to cstdio), eg:
printf("Are you the Mysterious Murdo?\n");
printf("Enter \'y\' for yes, \'n\' for no.\n");
fflush(stdout);
"You do that in some places but not others." stated one of the group's
posters. I initially took this to be a reference to the fact that I
hadn't flushed the output stream after every printf, but it occurs to
me that this could be saying one or more of:
a.) There are some platforms/situations where you have to include
fflush(stdout) after *every* printf call (as opposed, in my case, to
every group of printfs) else that call's parameter won't be displayed
on the screen.
b.) There are some platforms/situations where one should not use
fflush(stdout).
Can anyone help?
Thanks,
James McLaughlin.
I was recently writing a couple of functions to distribute on
comp.sys.sinclair. My code included the use of fflush(stdout) after
some of the output statements (I was using stdio.h instead of iostream
to cater for rather old compilers without an iostream equivalent to
the gets() function, but if anyone answers this I'd like to know if
their answer applies to cstdio), eg:
printf("Are you the Mysterious Murdo?\n");
printf("Enter \'y\' for yes, \'n\' for no.\n");
fflush(stdout);
"You do that in some places but not others." stated one of the group's
posters. I initially took this to be a reference to the fact that I
hadn't flushed the output stream after every printf, but it occurs to
me that this could be saying one or more of:
a.) There are some platforms/situations where you have to include
fflush(stdout) after *every* printf call (as opposed, in my case, to
every group of printfs) else that call's parameter won't be displayed
on the screen.
b.) There are some platforms/situations where one should not use
fflush(stdout).
Can anyone help?
Thanks,
James McLaughlin.