www.delorie.com/djgpp/bugs/show.cgi | search |
// 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!"
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.
webmaster | delorie software privacy |
Copyright © 2010 by DJ Delorie | Updated Jul 2010 |