Programming Windows D Examples are now Online!

Jimmy Cao jcao219 at gmail.com
Thu Jun 23 14:05:40 PDT 2011


On Thu, Jun 23, 2011 at 3:59 PM, Walter Bright
<newshound2 at digitalmars.com>wrote:

> On 6/23/2011 1:30 PM, Jimmy Cao wrote:
>
>>         stdout.setvbuf(100, _IOLBUF);
>>
>
>
> You're mixing up D and C stdio. Try using std.c.stdio.setvbuf().
>
>
It gives me the same result.

import std.stdio;

extern(C) int getch();

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();
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-announce/attachments/20110623/3e463114/attachment.html>


More information about the Digitalmars-d-announce mailing list