Mail Archives: djgpp/1999/01/07/18:45:15
MstrX1 wrote in message <19990107175907 DOT 21430 DOT 00007885 AT ng-fp1 DOT aol DOT com>...
>Hello,
>if I don't type a LF("\n") at the end of my printf-text
>the text isn't printed correctly under MS-DOS.
>Most times this isn't a problem, because I need
>it anyway, but if I want to print text at the bottom
>of the screen and I print (printf("Hello World\n")),
>the screen scrolls down and the top-line will be destroyed.
>
>How can I print it correctly without using a "\n" at the end,
>or stop this scrolling ?
>
>J. Diederich
>
Hello fellow newbie.
Insert the following line beneath the printf statement without the \n at the
end of the string.
fflush(stdout);
This empties the output buffer to the output device 'stdout' which is
defined in the stdio library.
- Raw text -