delorie.com/djgpp/bugs/show.cgi   search  
Bug 000190

When Created: 11/25/1997 10:26:20
Against DJGPP version: 2.01
By whom: Daniel.Horchner@95.Student.WAU.NL
Abstract: Strange bug in printf; Nothing is printed until the first newline char.
// Strange bug in printf; Nothing is printed until the first newline char.
#include <stdio.h>
#include <conio.h>

void main()
{
  printf("Hello, ");    // Nothing is printed.
  printf("world");      // Still nothing...
  putch('!');           // '!' on screen.
  puts("");             // "Hello, world" on screen.
}                       // Overal: "!Hello, world" instead of "Hello, world!"

Note added: 11/25/1997 15:12:56
By whom: broeker@physik.rwth-aachen.de
This is not a bug. In DJGPP, stdio is line-buffered, so you
have to call 'fflush(stdout)' if you want to see the results of
a 'printf()' call without an '
' immediately.

See the FAQ, paragraph, 9.4, about 'screen i/o':

	info faq running screen

for details.

Closed on 04/12/1999 10:00:06: Not a bug: stdout is line-buffered.
By whom: eliz@is.elta.co.il



  webmaster     delorie software   privacy  
  Copyright 2010   by DJ Delorie     Updated Jul 2010