On Thu, Jun 23, 2011 at 3:59 PM, Walter Bright
<[email protected]>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();
}