Mail Archives: djgpp/1996/04/30/08:28:06
"Alexander V. Lukyanov" <lav AT video DOT yars DOT free DOT net> wrote:
>> I wrote some simple code that utilizes the gotoxy() and printf()
>> statements to place text on the screen, ala:
>> When I run this type of code nothing appears on the screen. I can see
>> the cursor jumping around, but nothing else. However, if I include a
>> '\n' in the printf statement, things display fine, *or* as soon as I
>> printf with a '\n' outside the loop, then **all** the text gets
>> displayed. It's almost as if it's being buffered, and isn't displayed
>> until a '\n' comes along.
That is because you need to fflush(stdout) after you write a string
without a trailing "\n". It is a normal printf() "feature".
- Raw text -