Programming Windows D Examples are now Online!

Jimmy Cao jcao219 at gmail.com
Fri Jun 24 09:41:05 PDT 2011


On Fri, Jun 24, 2011 at 7:45 AM, Kagamin <spam at here.lot> wrote:

> Jimmy Cao Wrote:
>
> > void main()
> > {
> >     std.c.stdio.setvbuf(stdout.getFP, null, std.c.stdio._IOLBF, 100);
> >     string mystr = "Hello\n";
> >     fwrite(mystr.ptr, mystr[0].sizeof, mystr.length, stdout.getFP);
> >
> >     // FPUTC('\n', cast(_iobuf*)stdout.getFP);
> >
> >     getch();
> > }
>
> fwrite is from so called low-level file API supposed to write binary data
> without extra processing.
>

No, it writes to stdout which (in this case) is line-buffered.  Whenever
there's a newline character, it is supposed to flush.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-announce/attachments/20110624/ac8d7d59/attachment.html>


More information about the Digitalmars-d-announce mailing list