On Thu, Jun 23, 2011 at 3:59 PM, Walter Bright <span dir="ltr"><<a href="mailto:newshound2@digitalmars.com">newshound2@digitalmars.com</a>></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;">
On 6/23/2011 1:30 PM, Jimmy Cao wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
stdout.setvbuf(100, _IOLBUF);<br>
</blockquote>
<br>
<br>
You're mixing up D and C stdio. Try using std.c.stdio.setvbuf().<br>
<br>
</blockquote></div><br><div>It gives me the same result.</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div>import std.stdio;</div><div><br>
</div><div>extern(C) int getch();</div><div><br></div><div>void main()</div><div>{</div><div> std.c.stdio.setvbuf(stdout.getFP, null, std.c.stdio._IOLBF, 100);</div><div> string mystr = "Hello\n";</div><div>
fwrite(mystr.ptr, mystr[0].sizeof, mystr.length, stdout.getFP);</div><div> </div><div> // FPUTC('\n', cast(_iobuf*)stdout.getFP);</div><div><br></div><div> getch();</div><div>}</div></div></blockquote>