[so] Probleme cu Tema 1 SO

Maximilian Machedon maximilian.machedon at gmail.com
Thu Apr 3 10:39:07 EEST 2008


Daca pui fflush, merge sau in continuare nu merge?

Testele au fost concepute special ca sa folositi fflush (un shell e
interactiv prin definitie, deci va folosi fflush de fiecare data cand e
necesar).

2008/4/3 Sorin <sorin19840 at yahoo.com>:

> Si output-ul "gresit" afisat de programul meu e:
> output comanda1
> output comanda2
> output comanda3
> >>>
>
> ( fara sa scrie si comenzile inainte de output )
>
>
> *Daniel Baluta <daniel.baluta at gmail.com>* wrote:
>
>
>
> 2008/4/3 Sorin <sorin19840 at yahoo.com>:
>
> > La Tema 1 SO - mini-shell, considerand urmatorul cod:
> > char comanda[100];
> > void main()
> > {
> > while (1)
> > {
> >
>
> > printf("\");
> >
>
> aici sigur e asa ?
>
> >
> > gets(comanda)
> > // parsare + executa(comanda);
> > if (strncmp(comanda,"exit",4)==0)) break;
> > if (strncmp(comanda,"quit",4)==0)) break;
> > }
> > La rularea interactiva, nu e nici o problema, dar
> > daca ai intr-un fisier test.txt de exemplu
> > comanda1
> > comanda2
> > comanda3
> > exit
> > in loc sa afiseze;
> > >comanda1
> > output comanda1
> > >comanda2
> > output comanda2
> > >comanda3
> > output comanda3
> > afiseaza:
> > >comanda1
> > output comanda1
> > comanda2
> > output comanda2
> > comanda3
> > output comanda3
> > >>
> > ( linia > de prompt nu o pune inaintea comenzii, ci le pune pe toate la
> > sfarsit )
> > Din cauza asta, programul nu trece nici un test pe site.
> > Ai o idee/solutie?
> > PS: N-am folosit parserul de pe site. Nu pot folosi pointer si getline.
> >
>
>   ------------------------------
> > You rock. That's why Blockbuster's offering you one month of Blockbuster
> > Total Access<http://us.rd.yahoo.com/evt=47523/*http://tc.deals.yahoo.com/tc/blockbuster/text5.com>,
> > No Cost.
> > _______________________________________________
> > so mailing list
> > so at cursuri.cs.pub.ro
> > http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so
> >
> > _______________________________________________
> so mailing list
> so at cursuri.cs.pub.ro
> http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so
>
>
>  ------------------------------
> You rock. That's why Blockbuster's offering you one month of Blockbuster
> Total Access<http://us.rd.yahoo.com/evt=47523/*http://tc.deals.yahoo.com/tc/blockbuster/text5.com>,
> No Cost.
>
>
> _______________________________________________
> so mailing list
> so at cursuri.cs.pub.ro
> http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cursuri.cs.pub.ro/pipermail/so/attachments/20080403/9a9b8cb6/attachment-0001.htm 


More information about the so mailing list