Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- main() {
- // FILE *fp;
- //
- // fp = fopen("test.txt", "w+");
- // fprintf(fp, "This is testing for fprintf...\n");
- // fputs("This is testing for fputs...\n", fp);
- // fclose(fp);
- FILE *fp;
- char buff[255];
- fp = fopen("test.txt", "r");
- fscanf(fp, "%s", buff);
- printf("1 : %s\n", buff );
- fgets(buff, 255, (FILE*)fp);
- printf("2: %s\n", buff );
- fgets(buff, 255, (FILE*)fp);
- printf("3: %s\n", buff );
- fclose(fp);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement