stdout - autoflushing

Dejan Lekic dejan.lekic at gmail.com
Fri Dec 6 12:39:18 PST 2013


Benji wrote:

> Hello,
> in order to have correctly displayed output (before reading
> something from stdin),
> I must call stdout.flush().
> Sometimes, it's really annoying, especially when it is necessarry
> to call it 10 times.
> 
> For example:
> write("Enter some string: ");
> stdout.flush();
> string a = readln();
> write("And again please: ");
> stdout.flush();
> string b = readln();
> ...
> 
> Is there any way to prevent this?

I doubt. Your IDE is buffering application's streams.

-- 
Dejan Lekic
dejan.lekic (a) gmail.com
http://dejan.lekic.org


More information about the Digitalmars-d-learn mailing list