2
0

fseek.c 330 B

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