writef vs writeln and printing to the console

Christopher Nicholson-Sauls ibisbasenji at gmail.com
Sun Jan 9 03:17:41 PST 2011


On 01/08/11 17:03, Jesse Phillips wrote:
> Andrej Mitrovic Wrote:
> 
>> Unfortunately I can't provide a simple test case, but I have a case where using:
>>
>> writef("..........\n");
>>
>> inside a loop that runs a dozen times does not print out each line as the statement is reached, instead it prints out everything at once when the application is done. If I use this:
>>
>> writeln(".........");
>>
>> then I get each line printed out at the exact moment as this statement is reached. Is this normal behavior? 
> 
> I don't think new line means to flush the buffer like it does in printf. I think you can use stdout.flush() from stdio;
> 

What Jesse said, but also: I can't help wondering if there's a special
reason why you cannot (or would rather not) use writefln(".....")?

-- Chris N-S


More information about the Digitalmars-d-learn mailing list