[megoldva]printf+végtelen ciklus+gcc hiba?

Fórumok

Sziasztok.Valamiért furcsán fordul le egy programom.Itt van a linkje:http://www.hup.pastebin.com/m2a351cbc

Ha benn van a while (1){} rész,akkor nem ír ki az előtte lévő printf sem.Pedig szerintem kellene.Ez is csak nálam bugos,vagy másnál is hasonló a helyzet?

gcc tulajdonságai:
gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 (Ubuntu 4.1.2-0ubuntu4)

Hozzászólások

A

printf()

alapertelmezesben sorbufferelt (amennyiben az stdout egy terminal). Tehat, vagy zard le a sort (

"%d\n"

), vagy kozvetlenul urittesd a buffert:

fflush(stdout);

A.