On Fri, Jun 24, 2011 at 7:45 AM, Kagamin <span dir="ltr"><spam@here.lot></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">Jimmy Cao Wrote:<br>
<br>
> void main()<br>
> {<br>
>     std.c.stdio.setvbuf(stdout.getFP, null, std.c.stdio._IOLBF, 100);<br>
>     string mystr = "Hello\n";<br>
>     fwrite(mystr.ptr, mystr[0].sizeof, mystr.length, stdout.getFP);<br>
><br>
>     // FPUTC('\n', cast(_iobuf*)stdout.getFP);<br>
><br>
>     getch();<br>
> }<br>
<br>
</div>fwrite is from so called low-level file API supposed to write binary data without extra processing.<br>
</blockquote></div><br><div>No, it writes to stdout which (in this case) is line-buffered.  Whenever there's a newline character, it is supposed to flush.</div>