fseek.c 273 B

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