Programming Windows D Examples are now Online!

Jimmy Cao jcao219 at gmail.com
Fri Jun 24 13:19:51 PDT 2011


On Fri, Jun 24, 2011 at 3:03 PM, Kagamin <spam at here.lot> wrote:

> Jimmy Cao Wrote:
>
> > No, it writes to stdout which (in this case) is line-buffered.  Whenever
> > there's a newline character, it is supposed to flush.
>
> There're no characters in binary data. This is low-level API. If you want
> the library to care about characters and do various things, maybe you need a
> high-level text API like printf or even better phobos std.stdio.write?
>

Actually, low-level is like using cputs from conio.h.
http://www.digitalmars.com/rtl/conio.html

> "They bypass the stdin and stdout buffers and access the console
> directly."


Anyways, I was using to write an array of characters to stdout.  Since
stdout was buffered, when the newline character was encountered, flushing
should have occured.
Also, you do realize that std.stdio.write uses fwrite, right?  It's the same
thing, except when writing wider chars or when fwide doesn't return 0, in
that case something else is used.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-announce/attachments/20110624/a775072c/attachment.html>


More information about the Digitalmars-d-announce mailing list