Mail Archives: djgpp/1997/08/20/16:23:41
In article <33F13D7F DOT 423B9280 AT alcyone DOT com> Erik Max Francis <max AT alcyone DOT com> writes:
>John M. Aldrich wrote:
>
>> One of the features of the stdout buffering in DJGPP is that if you call
>> an input function that reads from stdin, the buffer is automatically
>> flushed. The following works perfectly, although it requires a carriage
>> return after the character is typed:
>>
>> printf( "Type a character: " );
>> getchar();
>
>This is actually assured by ANSI (7.9.3). If this doesn't work your
>compiler is not ANSI compliant.
Not really. It just may mean that the implementation doesn't have
anything that is an "interactive device" within the terms of the
standard. The standard only specifies what features something must
have to be called an "interactive device", it does not require that
such a device exist in the environment. It does not preclude the
existence of things that look very close to the "interactive devices"
of the standard but that can't be be called "interactive devices"
for technical reasons beyond the control of the C implementor.
Actually, it is not unknown for the above printf/getchar sequence to
work fine, but a printf/fflush/getchar sequence to fail (or seem to).
- Raw text -