probabil vroiai: printf(">");<br>incearca sa faci flush dupa printf (fflush(stdout)). <br><br><div class="gmail_quote">2008/4/3 Sorin <<a href="mailto:sorin19840@yahoo.com">sorin19840@yahoo.com</a>>:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>La Tema 1 SO - mini-shell, considerand urmatorul cod:</div> <div>char comanda[100];</div>
<div>void main()<br>{<br>while (1)<br>{<br>printf("\");<br>gets(comanda)<br>// parsare + executa(comanda);<br>if (strncmp(comanda,"exit",4)==0)) break;<br>if (strncmp(comanda,"quit",4)==0)) break;<br>
}</div> <div>La rularea interactiva, nu e nici o problema, dar <br>daca ai intr-un fisier test.txt de exemplu</div> <div>comanda1<br>comanda2<br>comanda3<br>exit</div> <div>in loc sa afiseze;</div> <div>>comanda1<br>
output comanda1<br>>comanda2<br>output comanda2<br>>comanda3<br>output comanda3</div> <div>afiseaza:</div> <div>>comanda1<br>output comanda1<br>comanda2<br>output comanda2<br>comanda3<br>output comanda3<br>>></div>
<div>( linia > de prompt nu o pune inaintea comenzii, ci le pune pe toate la sfarsit )</div> <div>Din cauza asta, programul nu trece nici un test pe site.<br>Ai o idee/solutie?</div> <div>PS: N-am folosit parserul de pe site. Nu
pot folosi pointer si getline. </div><p>
</p><hr size="1">You rock. That's why Blockbuster's offering you <a href="http://us.rd.yahoo.com/evt=47523/*http://tc.deals.yahoo.com/tc/blockbuster/text5.com" target="_blank">one month of Blockbuster Total Access</a>, No Cost.<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>
<br></blockquote></div><br><br clear="all"><br>-- <br>Alexandru Mošoi<br><a href="http://alexandru.mosoi.googlepages.com">http://alexandru.mosoi.googlepages.com</a><br><br>Please avoid sending me Word or PowerPoint attachments.<br>
See <a href="http://www.gnu.org/philosophy/no-word-attachments.html">http://www.gnu.org/philosophy/no-word-attachments.html</a>