fseek.c 304 B

12345678910111213
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main(void) {
  4. FILE *f = fopen("stdio/stdio.in", "r");
  5. if (fseek(f, 14, SEEK_CUR) < 0) {
  6. puts("fseek error");
  7. return EXIT_FAILURE;
  8. }
  9. char buffer[256];
  10. printf("%s", fgets(buffer, 256, f));
  11. printf("ftell: %ld\n", ftello(f));
  12. }