Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // creare si consultarepentru un fisier text care memoreaza elemente intregi
- /* La crearea fişierului, fişier conducător este fişierul standard de intrare.
- La afişare, conducător este fişierul f. */
- #include<stdio.h>
- #include<conio.h>
- #include<stdlib.h>
- void main()
- {
- int x;
- FILE* f;
- char* nume;
- long dim;
- f=fopen("nume.txt","w+");
- scanf("%d",&x);
- if(!feof(stdin))
- {
- fprintf(f,"%d",x);
- scanf("%d",&x);
- }
- fseek(f,0,SEEK_SET);
- fscanf(f,"%d",&x);
- while(!feof(f))
- {
- printf("%d",x);
- fscanf(f,"%d",&x);
- }
- fclose(f);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement