17.04.2013 Views

Florian Moraru PROGRAMAREA CALCULATOARELOR în limbajul C

Florian Moraru PROGRAMAREA CALCULATOARELOR în limbajul C

Florian Moraru PROGRAMAREA CALCULATOARELOR în limbajul C

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

do {<br />

printf("x,y= ");<br />

err= scanf("%d%d",&x,&y);<br />

if (err==2) break;<br />

fflush(stdin);<br />

} while (err != 2);<br />

c) In cazul scrierii <strong>în</strong>tr-un fisier disc, pentru a ne asigura cã toate datele din zona<br />

tampon vor fi scrise efectiv pe disc, <strong>în</strong>ainte de <strong>în</strong>chiderea fisierului. In exemplul<br />

urmãtor se foloseste “fflush” <strong>în</strong> loc de “fclose”:<br />

int main () {<br />

FILE * f; int c ; char numef[]="TEST.DAT";<br />

char x[ ]="0123456789";<br />

f=fopen (numef,"w");<br />

for (c=0;c

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!