On Thu, Jun 23, 2011 at 3:59 PM, Walter Bright <newshound2@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().
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();}