Programming Windows D Examples are now Online!

Steven Schveighoffer schveiguy at yahoo.com
Fri Jun 24 07:11:01 PDT 2011


On Fri, 24 Jun 2011 08:45:44 -0400, Kagamin <spam at here.lot> wrote:

> Jimmy Cao Wrote:
>
>> 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();
>> }
>
> fwrite is from so called low-level file API supposed to write binary  
> data without extra processing.

As stated in a previous post, it does flush on newline in Linux (just  
tested it).  I don't know if flushing-on-newline-if-console is part of the  
C standard, so both implementations are likely compliant.  But it is an  
inconsistency.

-Steve


More information about the Digitalmars-d-announce mailing list