Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- FILE *f = fopen("myfile.txt", "r");
- if (f == NULL)
- {
- printf("Cannot open file!\n");
- return 1;
- }
- fseek(f, 5, SEEK_SET);
- fseek(f, 1, SEEK_CUR);
- for (int i=0; i<5; i++)
- {
- char c = fgetc(f);
- printf("Character from file: %c\n", c);
- }
- fclose(f);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement