Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- main()
- {
- FILE *f;
- char s[50];
- // Tao file moi
- f = fopen("abc.txt","w");
- fprintf(f,"Tao file ne.");
- fclose(f);
- // Doc file
- f = fopen("abc.txt","r");
- fgets(s,50,f);
- printf("%s",s);
- fclose(f);
- // Ghi tiep vao 1 file
- f = fopen("abc.txt","a");
- fprintf(f,"Bo sung ne.");
- fclose(f);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment