Mail Archives: djgpp/1998/11/12/02:47:36
On Wed, 11 Nov 1998, Doug Scott wrote:
> The output is:
> Qaaazzz
>
> I would expect the output to be:
> aaaQzzz
Your expectations are wrong. `putch' uses direct screen writes to the
video memory of your SVGA, whereas `printf' buffers its output and
doesn't actually deliver it to the screen until the buffer is flushed.
(In your cases, it is flushed when your program exits.)
The DJGPP FAQ list (v2/faq211b.zip from the same place you get DJGPP)
explains that it is usually a bad idea to mix buffered I/O with direct
screen writes. See section 9.4 of the FAQ.
> test1 > out
>
> The character Q goes to the screen and the rest to the file.
> I cannot recall if putch() is "supposed to" use stdout or not and I
> have mentioned this here just in case it is.
`putch' writes characters directly to the video memory.
> I do not read the mail list but it would be nice to know if the bug is
> in my analysis or in the compiler/library.
This is no bug, it's how things should work.
- Raw text -