<div>Daca programul nu se termina normal, nu mai ai flush "gratuit". :-P</div>
<div> </div>
<div>exec pare un candidat bun pentru a explica problema. :-)<br><br></div>
<div class="gmail_quote">2008/4/7 Lucian Adrian Grijincu <<a href="mailto:lucian.grijincu@gmail.com">lucian.grijincu@gmail.com</a>>:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="Ih2E3d">> Maximilian Machedon <<a href="mailto:maximilian.machedon@gmail.com">maximilian.machedon@gmail.com</a>> wrote:<br>> Ma rog.. se face flush cand se termina programul (normal), deci probabil nu<br>
> e de la asta. :-P<br><br></div>2008/4/7 Tiugan Radu <<a href="mailto:tiuganradu@yahoo.com">tiuganradu@yahoo.com</a>>:<br>
<div class="Ih2E3d">> Asa m-am gandit si eu ca la terminarea programului se face flush. Dar chit<br>> ca am pus \n nu se facea. Am rezolvat cu un fflush.<br><br></div>How do you like them apples?<br><br>Standardul C spune ca la exit(3) trebuie să se inchida/flush-uiasca<br>
streamurile deschise:<br><q><br> Before termination it performs the following functions in the order<br> listed:<br> 1. Call the functions registered with the atexit(3) function, in<br> the reverse order of their registration.<br>
2. Flush all open output streams.<br> 3. Close all open streams.<br> 4. Unlink all files created with the tmpfile(3) function.<br> ...<br> The exit() function conforms to ISO/IEC 9899:1990 (``ISO C89'').<br>
</q><br><br><br>Altundeva spune că un program care se termină cu "return value;" din<br>main() e echivalent cu unul care dă exit(value).<br><br>Nu sunt sigur, dar cred ca FILE* sunt acele "streams" de care pomenește C89.<br>
<br>din man 3 exit:<br><q><br> All open stdio(3) streams are flushed and closed. Files created by<br> tmpfile(3) are removed.<br></q><br><br>Mă înșel?<br>Dacă da, atunci faptul că nu se face fflush automat ar trebui<br>
considerat un bug al [g]libc?<br>
<div>
<div></div>
<div class="Wj3C7c"><br>--<br>Lucian<br>_______________________________________________<br>so mailing list<br><a href="mailto:so@cursuri.cs.pub.ro">so@cursuri.cs.pub.ro</a><br><a href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so" target="_blank">http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br>
</div></div></blockquote></div><br>